| OLD | NEW |
| 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 EventCallback& event_callback, | 10 const EventCallback& event_callback, |
| 11 const ResponseCallback& response_callback) | 11 const ResponseCallback& response_callback) |
| 12 : event_callback_(event_callback), | 12 : event_callback_(event_callback), |
| 13 response_callback_(response_callback) { | 13 response_callback_(response_callback) { |
| 14 } | 14 } |
| 15 | 15 |
| 16 DevToolsProtocolClient::~DevToolsProtocolClient() { | 16 DevToolsProtocolClient::~DevToolsProtocolClient() { |
| 17 } | 17 } |
| 18 | 18 |
| 19 void DevToolsProtocolClient::SendNotification(const std::string& method, | 19 void DevToolsProtocolClient::SendNotification( |
| 20 base::DictionaryValue* params) { | 20 const std::string& method, |
| 21 event_callback_.Run(method, params); | 21 scoped_ptr<base::DictionaryValue> params) { |
| 22 event_callback_.Run(method, params.release()); |
| 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 response_callback_.Run(response); | 27 response_callback_.Run(response); |
| 27 } | 28 } |
| 28 | 29 |
| 29 void DevToolsProtocolClient::SendInvalidParamsResponse( | 30 void DevToolsProtocolClient::SendInvalidParamsResponse( |
| 30 scoped_refptr<DevToolsProtocol::Command> command, | 31 scoped_refptr<DevToolsProtocol::Command> command, |
| 31 const std::string& message) { | 32 const std::string& message) { |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 84 } | 85 } |
| 85 | 86 |
| 86 const std::string& Response::message() const { | 87 const std::string& Response::message() const { |
| 87 return message_; | 88 return message_; |
| 88 } | 89 } |
| 89 | 90 |
| 90 Response::Response() { | 91 Response::Response() { |
| 91 } | 92 } |
| 92 | 93 |
| 93 } // namespace content | 94 } // namespace content |
| OLD | NEW |