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 // TODO(clamy): Switch RenderFrameDevToolsAgentHost to always buffer messages |
566 DCHECK(IsBrowserSideNavigationEnabled()); | 566 // until ReadyToCommitNavigation is called, now that it is also called in |
| 567 // non-PlzNavigate mode. |
| 568 if (!IsBrowserSideNavigationEnabled()) |
| 569 return; |
567 | 570 |
568 // If the navigation is not tracked, return; | 571 // If the navigation is not tracked, return; |
569 if (navigating_handles_.count(navigation_handle) == 0) | 572 if (navigating_handles_.count(navigation_handle) == 0) |
570 return; | 573 return; |
571 | 574 |
572 RenderFrameHostImpl* render_frame_host_impl = | 575 RenderFrameHostImpl* render_frame_host_impl = |
573 static_cast<RenderFrameHostImpl*>( | 576 static_cast<RenderFrameHostImpl*>( |
574 navigation_handle->GetRenderFrameHost()); | 577 navigation_handle->GetRenderFrameHost()); |
575 if (current_->host() != render_frame_host_impl || current_frame_crashed_) { | 578 if (current_->host() != render_frame_host_impl || current_frame_crashed_) { |
576 SetPending(render_frame_host_impl); | 579 SetPending(render_frame_host_impl); |
(...skipping 449 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1026 RenderFrameHost* host) { | 1029 RenderFrameHost* host) { |
1027 return (current_ && current_->host() == host) || | 1030 return (current_ && current_->host() == host) || |
1028 (pending_ && pending_->host() == host); | 1031 (pending_ && pending_->host() == host); |
1029 } | 1032 } |
1030 | 1033 |
1031 bool RenderFrameDevToolsAgentHost::IsChildFrame() { | 1034 bool RenderFrameDevToolsAgentHost::IsChildFrame() { |
1032 return current_ && current_->host()->GetParent(); | 1035 return current_ && current_->host()->GetParent(); |
1033 } | 1036 } |
1034 | 1037 |
1035 } // namespace content | 1038 } // namespace content |
OLD | NEW |