| 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 551 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 562 RenderFrameDevToolsAgentHost::~RenderFrameDevToolsAgentHost() { | 562 RenderFrameDevToolsAgentHost::~RenderFrameDevToolsAgentHost() { |
| 563 Instances::iterator it = std::find(g_instances.Get().begin(), | 563 Instances::iterator it = std::find(g_instances.Get().begin(), |
| 564 g_instances.Get().end(), | 564 g_instances.Get().end(), |
| 565 this); | 565 this); |
| 566 if (it != g_instances.Get().end()) | 566 if (it != g_instances.Get().end()) |
| 567 g_instances.Get().erase(it); | 567 g_instances.Get().erase(it); |
| 568 } | 568 } |
| 569 | 569 |
| 570 void RenderFrameDevToolsAgentHost::ReadyToCommitNavigation( | 570 void RenderFrameDevToolsAgentHost::ReadyToCommitNavigation( |
| 571 NavigationHandle* navigation_handle) { | 571 NavigationHandle* navigation_handle) { |
| 572 // TODO(clamy): Switch RenderFrameDevToolsAgentHost to always buffer messages | 572 // ReadyToCommitNavigation should only be called in PlzNavigate. |
| 573 // until ReadyToCommitNavigation is called, now that it is also called in | 573 DCHECK(IsBrowserSideNavigationEnabled()); |
| 574 // non-PlzNavigate mode. | |
| 575 if (!IsBrowserSideNavigationEnabled()) | |
| 576 return; | |
| 577 | 574 |
| 578 // If the navigation is not tracked, return; | 575 // If the navigation is not tracked, return; |
| 579 if (navigating_handles_.count(navigation_handle) == 0) | 576 if (navigating_handles_.count(navigation_handle) == 0) |
| 580 return; | 577 return; |
| 581 | 578 |
| 582 RenderFrameHostImpl* render_frame_host_impl = | 579 RenderFrameHostImpl* render_frame_host_impl = |
| 583 static_cast<RenderFrameHostImpl*>( | 580 static_cast<RenderFrameHostImpl*>( |
| 584 navigation_handle->GetRenderFrameHost()); | 581 navigation_handle->GetRenderFrameHost()); |
| 585 if (current_->host() != render_frame_host_impl || current_frame_crashed_) { | 582 if (current_->host() != render_frame_host_impl || current_frame_crashed_) { |
| 586 SetPending(render_frame_host_impl); | 583 SetPending(render_frame_host_impl); |
| (...skipping 486 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1073 RenderFrameHost* host) { | 1070 RenderFrameHost* host) { |
| 1074 return (current_ && current_->host() == host) || | 1071 return (current_ && current_->host() == host) || |
| 1075 (pending_ && pending_->host() == host); | 1072 (pending_ && pending_->host() == host); |
| 1076 } | 1073 } |
| 1077 | 1074 |
| 1078 bool RenderFrameDevToolsAgentHost::IsChildFrame() { | 1075 bool RenderFrameDevToolsAgentHost::IsChildFrame() { |
| 1079 return current_ && current_->host()->GetParent(); | 1076 return current_ && current_->host()->GetParent(); |
| 1080 } | 1077 } |
| 1081 | 1078 |
| 1082 } // namespace content | 1079 } // namespace content |
| OLD | NEW |