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/render_view_devtools_agent_host.h" | 5 #include "content/browser/devtools/render_view_devtools_agent_host.h" |
6 | 6 |
7 #include "base/basictypes.h" | 7 #include "base/basictypes.h" |
8 #include "base/lazy_instance.h" | 8 #include "base/lazy_instance.h" |
9 #include "content/browser/child_process_security_policy_impl.h" | 9 #include "content/browser/child_process_security_policy_impl.h" |
10 #include "content/browser/devtools/devtools_manager_impl.h" | 10 #include "content/browser/devtools/devtools_manager_impl.h" |
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
153 } | 153 } |
154 | 154 |
155 // static | 155 // static |
156 bool RenderViewDevToolsAgentHost::DispatchIPCMessage( | 156 bool RenderViewDevToolsAgentHost::DispatchIPCMessage( |
157 RenderViewHost* source, | 157 RenderViewHost* source, |
158 const IPC::Message& message) { | 158 const IPC::Message& message) { |
159 RenderViewDevToolsAgentHost* agent_host = FindAgentHost(source); | 159 RenderViewDevToolsAgentHost* agent_host = FindAgentHost(source); |
160 return agent_host && agent_host->DispatchIPCMessage(message); | 160 return agent_host && agent_host->DispatchIPCMessage(message); |
161 } | 161 } |
162 | 162 |
163 RenderViewDevToolsAgentHost::RenderViewDevToolsAgentHost( | 163 RenderViewDevToolsAgentHost::RenderViewDevToolsAgentHost(RenderViewHost* rvh) |
164 RenderViewHost* rvh) | |
165 : render_view_host_(NULL), | 164 : render_view_host_(NULL), |
166 overrides_handler_(new RendererOverridesHandler(this)), | 165 overrides_handler_(new RendererOverridesHandler(this)), |
167 tracing_handler_(new DevToolsTracingHandler()), | 166 tracing_handler_( |
168 power_handler_(new DevToolsPowerHandler()) | 167 new DevToolsTracingHandler(DevToolsTracingHandler::Renderer)), |
169 { | 168 power_handler_(new DevToolsPowerHandler()) { |
170 SetRenderViewHost(rvh); | 169 SetRenderViewHost(rvh); |
171 DevToolsProtocol::Notifier notifier(base::Bind( | 170 DevToolsProtocol::Notifier notifier(base::Bind( |
172 &RenderViewDevToolsAgentHost::OnDispatchOnInspectorFrontend, | 171 &RenderViewDevToolsAgentHost::OnDispatchOnInspectorFrontend, |
173 base::Unretained(this))); | 172 base::Unretained(this))); |
174 overrides_handler_->SetNotifier(notifier); | 173 overrides_handler_->SetNotifier(notifier); |
175 tracing_handler_->SetNotifier(notifier); | 174 tracing_handler_->SetNotifier(notifier); |
176 power_handler_->SetNotifier(notifier); | 175 power_handler_->SetNotifier(notifier); |
177 g_instances.Get().push_back(this); | 176 g_instances.Get().push_back(this); |
178 AddRef(); // Balanced in RenderViewHostDestroyed. | 177 AddRef(); // Balanced in RenderViewHostDestroyed. |
179 } | 178 } |
(...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
433 | 432 |
434 void RenderViewDevToolsAgentHost::OnDispatchOnInspectorFrontend( | 433 void RenderViewDevToolsAgentHost::OnDispatchOnInspectorFrontend( |
435 const std::string& message) { | 434 const std::string& message) { |
436 if (!render_view_host_) | 435 if (!render_view_host_) |
437 return; | 436 return; |
438 DevToolsManagerImpl::GetInstance()->DispatchOnInspectorFrontend( | 437 DevToolsManagerImpl::GetInstance()->DispatchOnInspectorFrontend( |
439 this, message); | 438 this, message); |
440 } | 439 } |
441 | 440 |
442 } // namespace content | 441 } // namespace content |
OLD | NEW |