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 247 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
258 | 258 |
259 void DevToolsAgentHostImpl::HostClosed() { | 259 void DevToolsAgentHostImpl::HostClosed() { |
260 if (!client_) | 260 if (!client_) |
261 return; | 261 return; |
262 | 262 |
263 scoped_refptr<DevToolsAgentHostImpl> protect(this); | 263 scoped_refptr<DevToolsAgentHostImpl> protect(this); |
264 // Clear |client_| before notifying it. | 264 // Clear |client_| before notifying it. |
265 DevToolsAgentHostClient* client = client_; | 265 DevToolsAgentHostClient* client = client_; |
266 client_ = NULL; | 266 client_ = NULL; |
267 client->AgentHostClosed(this, false); | 267 client->AgentHostClosed(this, false); |
268 NotifyDetached(); | 268 InnerDetach(); |
269 } | 269 } |
270 | 270 |
271 void DevToolsAgentHostImpl::InspectElement(int x, int y) { | 271 void DevToolsAgentHostImpl::InspectElement(int x, int y) { |
272 } | 272 } |
273 | 273 |
274 void DevToolsAgentHostImpl::SendMessageToClient(int session_id, | 274 void DevToolsAgentHostImpl::SendMessageToClient(int session_id, |
275 const std::string& message) { | 275 const std::string& message) { |
276 if (!client_) | 276 if (!client_) |
277 return; | 277 return; |
278 // Filter any messages from previous sessions. | 278 // Filter any messages from previous sessions. |
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
410 if (message_buffer_.size() != message_buffer_size_) | 410 if (message_buffer_.size() != message_buffer_size_) |
411 return false; | 411 return false; |
412 callback_.Run(chunk.session_id, message_buffer_); | 412 callback_.Run(chunk.session_id, message_buffer_); |
413 message_buffer_ = std::string(); | 413 message_buffer_ = std::string(); |
414 message_buffer_size_ = 0; | 414 message_buffer_size_ = 0; |
415 } | 415 } |
416 return true; | 416 return true; |
417 } | 417 } |
418 | 418 |
419 } // namespace content | 419 } // namespace content |
OLD | NEW |