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

Unified Diff: components/devtools_http_handler/devtools_http_handler.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: components/devtools_http_handler/devtools_http_handler.cc
diff --git a/components/devtools_http_handler/devtools_http_handler.cc b/components/devtools_http_handler/devtools_http_handler.cc
index 3c9a8e77c4f6be7655be1bef58e8e015ffa94687..67c061c7cbf3eff91960876bcbf16fe29646df7f 100644
--- a/components/devtools_http_handler/devtools_http_handler.cc
+++ b/components/devtools_http_handler/devtools_http_handler.cc
@@ -813,13 +813,11 @@ void DevToolsHttpHandler::SendJson(int connection_id,
// Serialize value and message.
std::string json_value;
if (value) {
- base::JSONWriter::WriteWithOptions(value,
- base::JSONWriter::OPTIONS_PRETTY_PRINT,
- &json_value);
+ base::JSONWriter::WriteWithOptions(
+ *value, base::JSONWriter::OPTIONS_PRETTY_PRINT, &json_value);
}
std::string json_message;
- scoped_ptr<base::Value> message_object(new base::StringValue(message));
- base::JSONWriter::Write(message_object.get(), &json_message);
+ base::JSONWriter::Write(base::StringValue(message), &json_message);
net::HttpServerResponseInfo response(status_code);
response.SetBody(json_value + message, "application/json; charset=UTF-8");

Powered by Google App Engine
This is Rietveld 408576698