| 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_frame_devtools_agent_host.h" | 5 #include "content/browser/devtools/render_frame_devtools_agent_host.h" |
| 6 | 6 |
| 7 #include <tuple> | 7 #include <tuple> |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/guid.h" | 10 #include "base/guid.h" |
| (...skipping 545 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 556 RenderFrameDevToolsAgentHost::~RenderFrameDevToolsAgentHost() { | 556 RenderFrameDevToolsAgentHost::~RenderFrameDevToolsAgentHost() { |
| 557 Instances::iterator it = std::find(g_instances.Get().begin(), | 557 Instances::iterator it = std::find(g_instances.Get().begin(), |
| 558 g_instances.Get().end(), | 558 g_instances.Get().end(), |
| 559 this); | 559 this); |
| 560 if (it != g_instances.Get().end()) | 560 if (it != g_instances.Get().end()) |
| 561 g_instances.Get().erase(it); | 561 g_instances.Get().erase(it); |
| 562 } | 562 } |
| 563 | 563 |
| 564 void RenderFrameDevToolsAgentHost::ReadyToCommitNavigation( | 564 void RenderFrameDevToolsAgentHost::ReadyToCommitNavigation( |
| 565 NavigationHandle* navigation_handle) { | 565 NavigationHandle* navigation_handle) { |
| 566 // ReadyToCommitNavigation should only be called in PlzNavigate. | 566 // TODO(clamy): Switch RenderFrameDevToolsAgentHost to always buffer messages |
| 567 DCHECK(IsBrowserSideNavigationEnabled()); | 567 // until ReadyToCommitNavigation is called, now that it is also called in |
| 568 // non-PlzNavigate mode. |
| 569 if (!IsBrowserSideNavigationEnabled()) |
| 570 return; |
| 568 | 571 |
| 569 // If the navigation is not tracked, return; | 572 // If the navigation is not tracked, return; |
| 570 if (navigating_handles_.count(navigation_handle) == 0) | 573 if (navigating_handles_.count(navigation_handle) == 0) |
| 571 return; | 574 return; |
| 572 | 575 |
| 573 RenderFrameHostImpl* render_frame_host_impl = | 576 RenderFrameHostImpl* render_frame_host_impl = |
| 574 static_cast<RenderFrameHostImpl*>( | 577 static_cast<RenderFrameHostImpl*>( |
| 575 navigation_handle->GetRenderFrameHost()); | 578 navigation_handle->GetRenderFrameHost()); |
| 576 if (current_->host() != render_frame_host_impl || current_frame_crashed_) { | 579 if (current_->host() != render_frame_host_impl || current_frame_crashed_) { |
| 577 SetPending(render_frame_host_impl); | 580 SetPending(render_frame_host_impl); |
| (...skipping 449 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1027 RenderFrameHost* host) { | 1030 RenderFrameHost* host) { |
| 1028 return (current_ && current_->host() == host) || | 1031 return (current_ && current_->host() == host) || |
| 1029 (pending_ && pending_->host() == host); | 1032 (pending_ && pending_->host() == host); |
| 1030 } | 1033 } |
| 1031 | 1034 |
| 1032 bool RenderFrameDevToolsAgentHost::IsChildFrame() { | 1035 bool RenderFrameDevToolsAgentHost::IsChildFrame() { |
| 1033 return current_ && current_->host()->GetParent(); | 1036 return current_ && current_->host()->GetParent(); |
| 1034 } | 1037 } |
| 1035 | 1038 |
| 1036 } // namespace content | 1039 } // namespace content |
| OLD | NEW |