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

Side by Side Diff: content/browser/devtools/protocol/devtools_protocol_client.cc

Issue 642263004: [DevTools] Make generated protocol structs wrappers around DictionaryValue (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix that will be needed for browser protocol Created 6 years, 1 month 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 namespace content { 7 namespace content {
8 8
9 DevToolsProtocolClient::DevToolsProtocolClient( 9 DevToolsProtocolClient::DevToolsProtocolClient(
10 const RawMessageCallback& raw_message_callback) 10 const RawMessageCallback& raw_message_callback)
11 : raw_message_callback_(raw_message_callback) { 11 : raw_message_callback_(raw_message_callback) {
12 } 12 }
13 13
14 DevToolsProtocolClient::~DevToolsProtocolClient() { 14 DevToolsProtocolClient::~DevToolsProtocolClient() {
15 } 15 }
16 16
17 void DevToolsProtocolClient::SendNotification(const std::string& method, 17 void DevToolsProtocolClient::SendNotification(
18 base::DictionaryValue* params) { 18 const std::string& method,
19 scoped_ptr<base::DictionaryValue> params) {
19 scoped_refptr<DevToolsProtocol::Notification> notification = 20 scoped_refptr<DevToolsProtocol::Notification> notification =
20 new DevToolsProtocol::Notification(method, params); 21 new DevToolsProtocol::Notification(method, params.release());
21 SendRawMessage(notification->Serialize()); 22 SendRawMessage(notification->Serialize());
22 } 23 }
23 24
24 void DevToolsProtocolClient::SendAsyncResponse( 25 void DevToolsProtocolClient::SendAsyncResponse(
25 scoped_refptr<DevToolsProtocol::Response> response) { 26 scoped_refptr<DevToolsProtocol::Response> response) {
26 SendRawMessage(response->Serialize()); 27 SendRawMessage(response->Serialize());
27 } 28 }
28 29
29 void DevToolsProtocolClient::SendRawMessage(const std::string& message) { 30 void DevToolsProtocolClient::SendRawMessage(const std::string& message) {
30 raw_message_callback_.Run(message); 31 raw_message_callback_.Run(message);
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
88 } 89 }
89 90
90 const std::string& Response::message() const { 91 const std::string& Response::message() const {
91 return message_; 92 return message_;
92 } 93 }
93 94
94 Response::Response() { 95 Response::Response() {
95 } 96 }
96 97
97 } // namespace content 98 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698