Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(401)

Unified Diff: src/inspector/v8-console-message.cc

Issue 2899113003: Use all of the arguments to build the console messages
Patch Set: Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « AUTHORS ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/inspector/v8-console-message.cc
diff --git a/src/inspector/v8-console-message.cc b/src/inspector/v8-console-message.cc
index 22fe18137ede9a1cb1bda927634321fc7affd259..abbab1f6ce308525aace64bd73fc12a72b32acc4 100644
--- a/src/inspector/v8-console-message.cc
+++ b/src/inspector/v8-console-message.cc
@@ -65,10 +65,13 @@ const unsigned maxStackDepthLimit = 32;
class V8ValueStringBuilder {
public:
- static String16 toString(v8::Local<v8::Value> value,
+ static String16 toString(const std::vector<v8::Local<v8::Value>>& arguments,
v8::Local<v8::Context> context) {
V8ValueStringBuilder builder(context);
- if (!builder.append(value)) return String16();
+ for (size_t i = 0; i < arguments.size(); ++i) {
+ if (i > 0) builder.append(" ");
+ if (!builder.append(arguments.at(i))) return String16();
+ }
return builder.toString();
}
@@ -161,6 +164,11 @@ class V8ValueStringBuilder {
return true;
}
+ bool append(const String16& string) {
+ m_builder.append(string);
+ return true;
+ }
+
String16 toString() {
if (m_tryCatch.HasCaught()) return String16();
return m_builder.toString();
@@ -376,8 +384,7 @@ std::unique_ptr<V8ConsoleMessage> V8ConsoleMessage::createForConsoleAPI(
v8::debug::EstimatedValueSize(isolate, arguments.at(i));
}
if (arguments.size())
- message->m_message =
- V8ValueStringBuilder::toString(arguments[0], v8Context);
+ message->m_message = V8ValueStringBuilder::toString(arguments, v8Context);
v8::Isolate::MessageErrorLevel clientLevel = v8::Isolate::kMessageInfo;
if (type == ConsoleAPIType::kDebug || type == ConsoleAPIType::kCount ||
« no previous file with comments | « AUTHORS ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698