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 211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
222 RenderViewDevToolsAgentHost::~RenderViewDevToolsAgentHost() { | 222 RenderViewDevToolsAgentHost::~RenderViewDevToolsAgentHost() { |
223 Instances::iterator it = std::find(g_instances.Get().begin(), | 223 Instances::iterator it = std::find(g_instances.Get().begin(), |
224 g_instances.Get().end(), | 224 g_instances.Get().end(), |
225 this); | 225 this); |
226 if (it != g_instances.Get().end()) | 226 if (it != g_instances.Get().end()) |
227 g_instances.Get().erase(it); | 227 g_instances.Get().erase(it); |
228 } | 228 } |
229 | 229 |
230 void RenderViewDevToolsAgentHost::AboutToNavigateRenderView( | 230 void RenderViewDevToolsAgentHost::AboutToNavigateRenderView( |
231 RenderViewHost* dest_rvh) { | 231 RenderViewHost* dest_rvh) { |
232 if (!render_view_host_) | 232 if (!render_view_host_ || !IsAttached()) |
233 return; | 233 return; |
234 | 234 |
235 if (render_view_host_ == dest_rvh && static_cast<RenderViewHostImpl*>( | 235 if (render_view_host_ == dest_rvh && static_cast<RenderViewHostImpl*>( |
236 render_view_host_)->render_view_termination_status() == | 236 render_view_host_)->render_view_termination_status() == |
237 base::TERMINATION_STATUS_STILL_RUNNING) | 237 base::TERMINATION_STATUS_STILL_RUNNING) |
238 return; | 238 return; |
239 DisconnectRenderViewHost(); | 239 DisconnectRenderViewHost(); |
240 ConnectRenderViewHost(dest_rvh); | 240 ConnectRenderViewHost(dest_rvh); |
241 } | 241 } |
242 | 242 |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
334 if (render_view_host_) | 334 if (render_view_host_) |
335 GetContentClient()->browser()->ClearCache(render_view_host_); | 335 GetContentClient()->browser()->ClearCache(render_view_host_); |
336 } | 336 } |
337 | 337 |
338 void RenderViewDevToolsAgentHost::OnClearBrowserCookies() { | 338 void RenderViewDevToolsAgentHost::OnClearBrowserCookies() { |
339 if (render_view_host_) | 339 if (render_view_host_) |
340 GetContentClient()->browser()->ClearCookies(render_view_host_); | 340 GetContentClient()->browser()->ClearCookies(render_view_host_); |
341 } | 341 } |
342 | 342 |
343 } // namespace content | 343 } // namespace content |
OLD | NEW |