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 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
172 | 172 |
173 bool DevToolsAgentHostImpl::DispatchProtocolMessage( | 173 bool DevToolsAgentHostImpl::DispatchProtocolMessage( |
174 DevToolsAgentHostClient* client, | 174 DevToolsAgentHostClient* client, |
175 const std::string& message) { | 175 const std::string& message) { |
176 if (!client_ || client_ != client) | 176 if (!client_ || client_ != client) |
177 return false; | 177 return false; |
178 return DispatchProtocolMessage(message); | 178 return DispatchProtocolMessage(message); |
179 } | 179 } |
180 | 180 |
181 void DevToolsAgentHostImpl::InnerDetach() { | 181 void DevToolsAgentHostImpl::InnerDetach() { |
| 182 session_->ResetDispatcher(); |
182 Detach(); | 183 Detach(); |
183 io_context_.DiscardAllStreams(); | 184 io_context_.DiscardAllStreams(); |
184 session_.reset(); | 185 session_.reset(); |
185 NotifyDetached(); | 186 NotifyDetached(); |
186 } | 187 } |
187 | 188 |
188 bool DevToolsAgentHostImpl::IsAttached() { | 189 bool DevToolsAgentHostImpl::IsAttached() { |
189 return !!client_; | 190 return !!client_; |
190 } | 191 } |
191 | 192 |
(...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
409 if (message_buffer_.size() != message_buffer_size_) | 410 if (message_buffer_.size() != message_buffer_size_) |
410 return false; | 411 return false; |
411 callback_.Run(chunk.session_id, message_buffer_); | 412 callback_.Run(chunk.session_id, message_buffer_); |
412 message_buffer_ = std::string(); | 413 message_buffer_ = std::string(); |
413 message_buffer_size_ = 0; | 414 message_buffer_size_ = 0; |
414 } | 415 } |
415 return true; | 416 return true; |
416 } | 417 } |
417 | 418 |
418 } // namespace content | 419 } // namespace content |
OLD | NEW |