OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/devtools_agent_host_impl.h" | 5 #include "content/browser/devtools/devtools_agent_host_impl.h" |
6 | 6 |
7 #include <map> | 7 #include <map> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 235 matching lines...) Loading... |
246 void DevToolsAgentHostImpl::SendProtocolResponse(int session_id, | 246 void DevToolsAgentHostImpl::SendProtocolResponse(int session_id, |
247 const std::string& message) { | 247 const std::string& message) { |
248 SendMessageToClient(session_id, message); | 248 SendMessageToClient(session_id, message); |
249 } | 249 } |
250 | 250 |
251 void DevToolsAgentHostImpl::SendProtocolNotification( | 251 void DevToolsAgentHostImpl::SendProtocolNotification( |
252 const std::string& message) { | 252 const std::string& message) { |
253 SendMessageToClient(session_id_, message); | 253 SendMessageToClient(session_id_, message); |
254 } | 254 } |
255 | 255 |
| 256 void DevToolsAgentHostImpl::sendProtocolResponse(int callId, |
| 257 const std::string& message) { |
| 258 // TODO(dgozman): grab session id from the session object. |
| 259 SendMessageToClient(session_id_, message); |
| 260 } |
| 261 |
| 262 void DevToolsAgentHostImpl::sendProtocolNotification( |
| 263 const std::string& message) { |
| 264 SendMessageToClient(session_id_, message); |
| 265 } |
| 266 |
| 267 void DevToolsAgentHostImpl::flushProtocolNotifications() { |
| 268 } |
| 269 |
256 void DevToolsAgentHostImpl::HostClosed() { | 270 void DevToolsAgentHostImpl::HostClosed() { |
257 if (!client_) | 271 if (!client_) |
258 return; | 272 return; |
259 | 273 |
260 scoped_refptr<DevToolsAgentHostImpl> protect(this); | 274 scoped_refptr<DevToolsAgentHostImpl> protect(this); |
261 // Clear |client_| before notifying it. | 275 // Clear |client_| before notifying it. |
262 DevToolsAgentHostClient* client = client_; | 276 DevToolsAgentHostClient* client = client_; |
263 client_ = NULL; | 277 client_ = NULL; |
264 client->AgentHostClosed(this, false); | 278 client->AgentHostClosed(this, false); |
265 NotifyDetached(); | 279 NotifyDetached(); |
(...skipping 141 matching lines...) Loading... |
407 if (message_buffer_.size() != message_buffer_size_) | 421 if (message_buffer_.size() != message_buffer_size_) |
408 return false; | 422 return false; |
409 callback_.Run(chunk.session_id, message_buffer_); | 423 callback_.Run(chunk.session_id, message_buffer_); |
410 message_buffer_ = std::string(); | 424 message_buffer_ = std::string(); |
411 message_buffer_size_ = 0; | 425 message_buffer_size_ = 0; |
412 } | 426 } |
413 return true; | 427 return true; |
414 } | 428 } |
415 | 429 |
416 } // namespace content | 430 } // namespace content |
OLD | NEW |