OLD | NEW |
---|---|
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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/ipc_devtools_agent_host.h" | 5 #include "content/browser/devtools/ipc_devtools_agent_host.h" |
6 | 6 |
7 namespace content { | 7 namespace content { |
8 | 8 |
9 void IPCDevToolsAgentHost::Attach() { | 9 void IPCDevToolsAgentHost::Attach() { |
10 SendMessageToAgent(new DevToolsAgentMsg_Attach(MSG_ROUTING_NONE, GetId())); | 10 SendMessageToAgent(new DevToolsAgentMsg_Attach(MSG_ROUTING_NONE, GetId())); |
11 OnClientAttached(); | 11 OnClientAttached(); |
12 } | 12 } |
13 | 13 |
14 void IPCDevToolsAgentHost::Detach() { | 14 void IPCDevToolsAgentHost::Detach() { |
15 SendMessageToAgent(new DevToolsAgentMsg_Detach(MSG_ROUTING_NONE)); | 15 SendMessageToAgent(new DevToolsAgentMsg_Detach(MSG_ROUTING_NONE)); |
16 OnClientDetached(); | 16 OnClientDetached(); |
17 } | 17 } |
18 | 18 |
19 void IPCDevToolsAgentHost::DispatchProtocolMessage( | 19 bool IPCDevToolsAgentHost::DispatchProtocolMessage( |
20 const std::string& message) { | 20 const std::string& message) { |
21 SendMessageToAgent(new DevToolsAgentMsg_DispatchOnInspectorBackend( | 21 if (!DevToolsAgentHostImpl::DispatchProtocolMessage(message)) { |
pfeldman
2015/03/23 09:59:01
Replace nested condition with guard expression:
i
Kunihiko Sakamoto
2015/03/23 10:23:58
Done.
| |
22 SendMessageToAgent(new DevToolsAgentMsg_DispatchOnInspectorBackend( | |
22 MSG_ROUTING_NONE, message)); | 23 MSG_ROUTING_NONE, message)); |
24 } | |
25 return true; | |
23 } | 26 } |
24 | 27 |
25 void IPCDevToolsAgentHost::InspectElement(int x, int y) { | 28 void IPCDevToolsAgentHost::InspectElement(int x, int y) { |
26 SendMessageToAgent(new DevToolsAgentMsg_InspectElement(MSG_ROUTING_NONE, | 29 SendMessageToAgent(new DevToolsAgentMsg_InspectElement(MSG_ROUTING_NONE, |
27 GetId(), x, y)); | 30 GetId(), x, y)); |
28 } | 31 } |
29 | 32 |
30 IPCDevToolsAgentHost::IPCDevToolsAgentHost() | 33 IPCDevToolsAgentHost::IPCDevToolsAgentHost() |
31 : message_buffer_size_(0) { | 34 : message_buffer_size_(0) { |
32 } | 35 } |
(...skipping 30 matching lines...) Expand all Loading... | |
63 | 66 |
64 if (chunk.is_last) { | 67 if (chunk.is_last) { |
65 CHECK(message_buffer_.size() == message_buffer_size_); | 68 CHECK(message_buffer_.size() == message_buffer_size_); |
66 SendMessageToClient(message_buffer_); | 69 SendMessageToClient(message_buffer_); |
67 message_buffer_ = std::string(); | 70 message_buffer_ = std::string(); |
68 message_buffer_size_ = 0; | 71 message_buffer_size_ = 0; |
69 } | 72 } |
70 } | 73 } |
71 | 74 |
72 } // namespace content | 75 } // namespace content |
OLD | NEW |