| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 "components/ui_devtools/devtools_client.h" | 5 #include "components/ui_devtools/devtools_client.h" |
| 6 | 6 |
| 7 #include "components/ui_devtools/devtools_server.h" | 7 #include "components/ui_devtools/devtools_server.h" |
| 8 | 8 |
| 9 namespace ui { | 9 namespace ui { |
| 10 namespace devtools { | 10 namespace devtools { |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 44 | 44 |
| 45 const std::string& UiDevToolsClient::name() const { | 45 const std::string& UiDevToolsClient::name() const { |
| 46 return name_; | 46 return name_; |
| 47 } | 47 } |
| 48 | 48 |
| 49 void UiDevToolsClient::DisableAllAgents() { | 49 void UiDevToolsClient::DisableAllAgents() { |
| 50 for (std::unique_ptr<UiDevToolsAgent>& agent : agents_) | 50 for (std::unique_ptr<UiDevToolsAgent>& agent : agents_) |
| 51 agent->Disable(); | 51 agent->Disable(); |
| 52 } | 52 } |
| 53 | 53 |
| 54 void UiDevToolsClient::sendProtocolResponse(int callId, const String& message) { | 54 void UiDevToolsClient::sendProtocolResponse( |
| 55 int callId, |
| 56 std::unique_ptr<protocol::Serializable> message) { |
| 55 if (connected()) | 57 if (connected()) |
| 56 server_->SendOverWebSocket(connection_id_, message); | 58 server_->SendOverWebSocket(connection_id_, message->serialize()); |
| 57 } | 59 } |
| 58 | 60 |
| 59 void UiDevToolsClient::sendProtocolNotification(const String& message) { | 61 void UiDevToolsClient::sendProtocolNotification( |
| 62 std::unique_ptr<protocol::Serializable> message) { |
| 60 if (connected()) | 63 if (connected()) |
| 61 server_->SendOverWebSocket(connection_id_, message); | 64 server_->SendOverWebSocket(connection_id_, message->serialize()); |
| 62 } | 65 } |
| 63 | 66 |
| 64 void UiDevToolsClient::flushProtocolNotifications() { | 67 void UiDevToolsClient::flushProtocolNotifications() { |
| 65 NOTIMPLEMENTED(); | 68 NOTIMPLEMENTED(); |
| 66 } | 69 } |
| 67 | 70 |
| 68 } // namespace devtools | 71 } // namespace devtools |
| 69 } // namespace ui | 72 } // namespace ui |
| OLD | NEW |