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/forwarding_agent_host.h" | 5 #include "content/browser/devtools/forwarding_agent_host.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "content/browser/devtools/devtools_manager.h" | |
8 #include "content/browser/devtools/protocol/inspector_handler.h" | 9 #include "content/browser/devtools/protocol/inspector_handler.h" |
9 | 10 |
10 namespace content { | 11 namespace content { |
11 | 12 |
12 ForwardingAgentHost::ForwardingAgentHost( | 13 ForwardingAgentHost::ForwardingAgentHost( |
13 const std::string& id, | 14 const std::string& id, |
14 std::unique_ptr<DevToolsExternalAgentProxyDelegate> delegate) | 15 std::unique_ptr<DevToolsExternalAgentProxyDelegate> delegate) |
15 : DevToolsAgentHostImpl(id), | 16 : DevToolsAgentHostImpl(id), |
16 delegate_(std::move(delegate)) { | 17 delegate_(std::move(delegate)) { |
18 DevToolsManager::GetInstance()->AgentHostCreated(this); | |
pfeldman
2016/10/12 23:11:18
Why not the DevToolsAgentHostImpl?
dgozman
2016/10/12 23:23:12
Subclasses are not yet fully initialized in DevToo
| |
17 } | 19 } |
18 | 20 |
19 ForwardingAgentHost::~ForwardingAgentHost() { | 21 ForwardingAgentHost::~ForwardingAgentHost() { |
22 DevToolsManager::GetInstance()->AgentHostDestroyed(this); | |
20 } | 23 } |
21 | 24 |
22 void ForwardingAgentHost::DispatchOnClientHost(const std::string& message) { | 25 void ForwardingAgentHost::DispatchOnClientHost(const std::string& message) { |
23 SendMessageToClient(session_id(), message); | 26 SendMessageToClient(session_id(), message); |
24 } | 27 } |
25 | 28 |
26 void ForwardingAgentHost::ConnectionClosed() { | 29 void ForwardingAgentHost::ConnectionClosed() { |
27 HostClosed(); | 30 HostClosed(); |
28 } | 31 } |
29 | 32 |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
67 | 70 |
68 void ForwardingAgentHost::Reload() { | 71 void ForwardingAgentHost::Reload() { |
69 delegate_->Reload(); | 72 delegate_->Reload(); |
70 } | 73 } |
71 | 74 |
72 bool ForwardingAgentHost::Close() { | 75 bool ForwardingAgentHost::Close() { |
73 return delegate_->Close(); | 76 return delegate_->Close(); |
74 } | 77 } |
75 | 78 |
76 } // content | 79 } // content |
OLD | NEW |