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

Side by Side Diff: content/browser/devtools/protocol/devtools_protocol_client.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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/browser/devtools/protocol/devtools_protocol_client.h" 5 #include "content/browser/devtools/protocol/devtools_protocol_client.h"
6 6
7 #include "base/json/json_writer.h" 7 #include "base/json/json_writer.h"
8 #include "base/strings/stringprintf.h" 8 #include "base/strings/stringprintf.h"
9 9
10 namespace content { 10 namespace content {
(...skipping 28 matching lines...) Expand all
39 39
40 DevToolsProtocolClient::~DevToolsProtocolClient() { 40 DevToolsProtocolClient::~DevToolsProtocolClient() {
41 } 41 }
42 42
43 void DevToolsProtocolClient::SendRawMessage(const std::string& message) { 43 void DevToolsProtocolClient::SendRawMessage(const std::string& message) {
44 raw_message_callback_.Run(message); 44 raw_message_callback_.Run(message);
45 } 45 }
46 46
47 void DevToolsProtocolClient::SendMessage(const base::DictionaryValue& message) { 47 void DevToolsProtocolClient::SendMessage(const base::DictionaryValue& message) {
48 std::string json_message; 48 std::string json_message;
49 base::JSONWriter::Write(&message, &json_message); 49 base::JSONWriter::Write(message, &json_message);
50 SendRawMessage(json_message); 50 SendRawMessage(json_message);
51 } 51 }
52 52
53 void DevToolsProtocolClient::SendNotification( 53 void DevToolsProtocolClient::SendNotification(
54 const std::string& method, 54 const std::string& method,
55 scoped_ptr<base::DictionaryValue> params) { 55 scoped_ptr<base::DictionaryValue> params) {
56 base::DictionaryValue notification; 56 base::DictionaryValue notification;
57 notification.SetString(kMethodParam, method); 57 notification.SetString(kMethodParam, method);
58 if (params) 58 if (params)
59 notification.Set(kParamsParam, params.release()); 59 notification.Set(kParamsParam, params.release());
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
133 Response::Response(int status) 133 Response::Response(int status)
134 : status_(status) { 134 : status_(status) {
135 } 135 }
136 136
137 Response::Response(int status, const std::string& message) 137 Response::Response(int status, const std::string& message)
138 : status_(status), 138 : status_(status),
139 message_(message) { 139 message_(message) {
140 } 140 }
141 141
142 } // namespace content 142 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698