| 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 544 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 555 RenderFrameDevToolsAgentHost::~RenderFrameDevToolsAgentHost() { | 555 RenderFrameDevToolsAgentHost::~RenderFrameDevToolsAgentHost() { |
| 556 Instances::iterator it = std::find(g_instances.Get().begin(), | 556 Instances::iterator it = std::find(g_instances.Get().begin(), |
| 557 g_instances.Get().end(), | 557 g_instances.Get().end(), |
| 558 this); | 558 this); |
| 559 if (it != g_instances.Get().end()) | 559 if (it != g_instances.Get().end()) |
| 560 g_instances.Get().erase(it); | 560 g_instances.Get().erase(it); |
| 561 } | 561 } |
| 562 | 562 |
| 563 void RenderFrameDevToolsAgentHost::ReadyToCommitNavigation( | 563 void RenderFrameDevToolsAgentHost::ReadyToCommitNavigation( |
| 564 NavigationHandle* navigation_handle) { | 564 NavigationHandle* navigation_handle) { |
| 565 // ReadyToCommitNavigation should only be called in PlzNavigate. | 565 if (!IsBrowserSideNavigationEnabled()) |
| 566 DCHECK(IsBrowserSideNavigationEnabled()); | 566 return; |
| 567 | 567 |
| 568 // If the navigation is not tracked, return; | 568 // If the navigation is not tracked, return; |
| 569 if (navigating_handles_.count(navigation_handle) == 0) | 569 if (navigating_handles_.count(navigation_handle) == 0) |
| 570 return; | 570 return; |
| 571 | 571 |
| 572 RenderFrameHostImpl* render_frame_host_impl = | 572 RenderFrameHostImpl* render_frame_host_impl = |
| 573 static_cast<RenderFrameHostImpl*>( | 573 static_cast<RenderFrameHostImpl*>( |
| 574 navigation_handle->GetRenderFrameHost()); | 574 navigation_handle->GetRenderFrameHost()); |
| 575 if (current_->host() != render_frame_host_impl || current_frame_crashed_) { | 575 if (current_->host() != render_frame_host_impl || current_frame_crashed_) { |
| 576 SetPending(render_frame_host_impl); | 576 SetPending(render_frame_host_impl); |
| (...skipping 446 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1023 RenderFrameHost* host) { | 1023 RenderFrameHost* host) { |
| 1024 return (current_ && current_->host() == host) || | 1024 return (current_ && current_->host() == host) || |
| 1025 (pending_ && pending_->host() == host); | 1025 (pending_ && pending_->host() == host); |
| 1026 } | 1026 } |
| 1027 | 1027 |
| 1028 bool RenderFrameDevToolsAgentHost::IsChildFrame() { | 1028 bool RenderFrameDevToolsAgentHost::IsChildFrame() { |
| 1029 return current_ && current_->host()->GetParent(); | 1029 return current_ && current_->host()->GetParent(); |
| 1030 } | 1030 } |
| 1031 | 1031 |
| 1032 } // namespace content | 1032 } // namespace content |
| OLD | NEW |