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

Unified Diff: content/shell/browser/shell_devtools_frontend.cc

Issue 1131113004: Convert JsonWriter::Write to taking a const ref for the in-param (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: another rebase Created 5 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
Index: content/shell/browser/shell_devtools_frontend.cc
diff --git a/content/shell/browser/shell_devtools_frontend.cc b/content/shell/browser/shell_devtools_frontend.cc
index 0cd1c9365910858d0301af76a1b96f26283a7571..2ad0c2ed445d9d8a0cd259dbe6aef21329a3073e 100644
--- a/content/shell/browser/shell_devtools_frontend.cc
+++ b/content/shell/browser/shell_devtools_frontend.cc
@@ -267,9 +267,9 @@ void ShellDevToolsFrontend::DispatchProtocolMessage(
base::FundamentalValue total_size(static_cast<int>(message.length()));
for (size_t pos = 0; pos < message.length(); pos += kMaxMessageChunkSize) {
- base::StringValue message_value(message.substr(pos, kMaxMessageChunkSize));
std::string param;
- base::JSONWriter::Write(&message_value, &param);
+ base::JSONWriter::Write(
+ base::StringValue(message.substr(pos, kMaxMessageChunkSize)), &param);
std::string code = "DevToolsAPI.dispatchMessageChunk(" + param + ");";
base::string16 javascript = base::UTF8ToUTF16(code);
web_contents()->GetMainFrame()->ExecuteJavaScript(javascript);
@@ -308,13 +308,13 @@ void ShellDevToolsFrontend::CallClientFunction(
std::string javascript = function_name + "(";
if (arg1) {
std::string json;
- base::JSONWriter::Write(arg1, &json);
+ base::JSONWriter::Write(*arg1, &json);
javascript.append(json);
if (arg2) {
- base::JSONWriter::Write(arg2, &json);
+ base::JSONWriter::Write(*arg2, &json);
javascript.append(", ").append(json);
if (arg3) {
- base::JSONWriter::Write(arg3, &json);
+ base::JSONWriter::Write(*arg3, &json);
javascript.append(", ").append(json);
}
}
« no previous file with comments | « content/renderer/stats_collection_controller.cc ('k') | content/shell/renderer/layout_test/leak_detector.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698