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