Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/browser_devtools_agent_host.h" | 5 #include "content/browser/devtools/browser_devtools_agent_host.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/guid.h" | 8 #include "base/guid.h" |
| 9 #include "base/json/json_reader.h" | 9 #include "base/json/json_reader.h" |
| 10 #include "content/browser/devtools/devtools_session.h" | 10 #include "content/browser/devtools/devtools_session.h" |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 51 tethering_handler_->Wire(session()->dispatcher()); | 51 tethering_handler_->Wire(session()->dispatcher()); |
| 52 | 52 |
| 53 tracing_handler_.reset(new protocol::TracingHandler( | 53 tracing_handler_.reset(new protocol::TracingHandler( |
| 54 protocol::TracingHandler::Browser, | 54 protocol::TracingHandler::Browser, |
| 55 FrameTreeNode::kFrameTreeNodeInvalidId, | 55 FrameTreeNode::kFrameTreeNodeInvalidId, |
| 56 GetIOContext())); | 56 GetIOContext())); |
| 57 tracing_handler_->Wire(session()->dispatcher()); | 57 tracing_handler_->Wire(session()->dispatcher()); |
| 58 } | 58 } |
| 59 | 59 |
| 60 void BrowserDevToolsAgentHost::Detach() { | 60 void BrowserDevToolsAgentHost::Detach() { |
| 61 io_handler_->Disable(); | |
|
caseq
2016/12/06 18:42:13
Here and below, let's get this done in destructor.
| |
| 61 io_handler_.reset(); | 62 io_handler_.reset(); |
| 63 memory_handler_->Disable(); | |
| 62 memory_handler_.reset(); | 64 memory_handler_.reset(); |
| 65 system_info_handler_->Disable(); | |
| 63 system_info_handler_.reset(); | 66 system_info_handler_.reset(); |
| 67 tethering_handler_->Disable(); | |
| 64 tethering_handler_.reset(); | 68 tethering_handler_.reset(); |
| 69 tracing_handler_->Disable(); | |
| 65 tracing_handler_.reset(); | 70 tracing_handler_.reset(); |
| 66 } | 71 } |
| 67 | 72 |
| 68 std::string BrowserDevToolsAgentHost::GetType() { | 73 std::string BrowserDevToolsAgentHost::GetType() { |
| 69 return kTypeBrowser; | 74 return kTypeBrowser; |
| 70 } | 75 } |
| 71 | 76 |
| 72 std::string BrowserDevToolsAgentHost::GetTitle() { | 77 std::string BrowserDevToolsAgentHost::GetTitle() { |
| 73 return ""; | 78 return ""; |
| 74 } | 79 } |
| (...skipping 13 matching lines...) Expand all Loading... | |
| 88 void BrowserDevToolsAgentHost::Reload() { | 93 void BrowserDevToolsAgentHost::Reload() { |
| 89 } | 94 } |
| 90 | 95 |
| 91 bool BrowserDevToolsAgentHost::DispatchProtocolMessage( | 96 bool BrowserDevToolsAgentHost::DispatchProtocolMessage( |
| 92 const std::string& message) { | 97 const std::string& message) { |
| 93 session()->dispatcher()->dispatch(protocol::StringUtil::parseJSON(message)); | 98 session()->dispatcher()->dispatch(protocol::StringUtil::parseJSON(message)); |
| 94 return true; | 99 return true; |
| 95 } | 100 } |
| 96 | 101 |
| 97 } // content | 102 } // content |
| OLD | NEW |