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 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
201 } | 201 } |
202 | 202 |
203 void RenderViewDevToolsAgentHost::OnClientDetached() { | 203 void RenderViewDevToolsAgentHost::OnClientDetached() { |
204 #if defined(OS_ANDROID) | 204 #if defined(OS_ANDROID) |
205 power_save_blocker_.reset(); | 205 power_save_blocker_.reset(); |
206 #endif | 206 #endif |
207 overrides_handler_->OnClientDetached(); | 207 overrides_handler_->OnClientDetached(); |
208 tracing_handler_->OnClientDetached(); | 208 tracing_handler_->OnClientDetached(); |
209 power_handler_->OnClientDetached(); | 209 power_handler_->OnClientDetached(); |
210 ClientDetachedFromRenderer(); | 210 ClientDetachedFromRenderer(); |
| 211 |
| 212 // TODO(kaznacheev): Move this call back to DevToolsManagerImpl when |
| 213 // extensions::ProcessManager no longer relies on this notification. |
| 214 if (!reattaching_) |
| 215 DevToolsManagerImpl::GetInstance()->NotifyObservers(this, false); |
211 } | 216 } |
212 | 217 |
213 void RenderViewDevToolsAgentHost::ClientDetachedFromRenderer() { | 218 void RenderViewDevToolsAgentHost::ClientDetachedFromRenderer() { |
214 if (!render_view_host_) | 219 if (!render_view_host_) |
215 return; | 220 return; |
216 | 221 |
217 InnerClientDetachedFromRenderer(); | 222 InnerClientDetachedFromRenderer(); |
218 | |
219 // TODO(kaznacheev): Move this call back to DevToolsManagerImpl when | |
220 // extensions::ProcessManager no longer relies on this notification. | |
221 if (!reattaching_) | |
222 DevToolsManagerImpl::GetInstance()->NotifyObservers(this, false); | |
223 } | 223 } |
224 | 224 |
225 void RenderViewDevToolsAgentHost::InnerClientDetachedFromRenderer() { | 225 void RenderViewDevToolsAgentHost::InnerClientDetachedFromRenderer() { |
226 bool process_has_agents = false; | 226 bool process_has_agents = false; |
227 RenderProcessHost* render_process_host = render_view_host_->GetProcess(); | 227 RenderProcessHost* render_process_host = render_view_host_->GetProcess(); |
228 for (Instances::iterator it = g_instances.Get().begin(); | 228 for (Instances::iterator it = g_instances.Get().begin(); |
229 it != g_instances.Get().end(); ++it) { | 229 it != g_instances.Get().end(); ++it) { |
230 if (*it == this || !(*it)->IsAttached()) | 230 if (*it == this || !(*it)->IsAttached()) |
231 continue; | 231 continue; |
232 RenderViewHost* rvh = (*it)->render_view_host_; | 232 RenderViewHost* rvh = (*it)->render_view_host_; |
(...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
445 DevToolsProtocol::ParseNotification(message); | 445 DevToolsProtocol::ParseNotification(message); |
446 | 446 |
447 if (notification) { | 447 if (notification) { |
448 tracing_handler_->HandleNotification(notification); | 448 tracing_handler_->HandleNotification(notification); |
449 } | 449 } |
450 DevToolsManagerImpl::GetInstance()->DispatchOnInspectorFrontend( | 450 DevToolsManagerImpl::GetInstance()->DispatchOnInspectorFrontend( |
451 this, message); | 451 this, message); |
452 } | 452 } |
453 | 453 |
454 } // namespace content | 454 } // namespace content |
OLD | NEW |