OLD | NEW |
---|---|
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/frame_host/render_frame_host_manager.h" | 5 #include "content/browser/frame_host/render_frame_host_manager.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 437 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
448 CommitPendingIfNecessary(render_frame_host, was_caused_by_user_gesture); | 448 CommitPendingIfNecessary(render_frame_host, was_caused_by_user_gesture); |
449 | 449 |
450 // Make sure any dynamic changes to this frame's sandbox flags that were made | 450 // Make sure any dynamic changes to this frame's sandbox flags that were made |
451 // prior to navigation take effect. | 451 // prior to navigation take effect. |
452 CommitPendingSandboxFlags(); | 452 CommitPendingSandboxFlags(); |
453 } | 453 } |
454 | 454 |
455 void RenderFrameHostManager::CommitPendingIfNecessary( | 455 void RenderFrameHostManager::CommitPendingIfNecessary( |
456 RenderFrameHostImpl* render_frame_host, | 456 RenderFrameHostImpl* render_frame_host, |
457 bool was_caused_by_user_gesture) { | 457 bool was_caused_by_user_gesture) { |
458 // Note: In PlzNavigate |cross_navigation_pending_| being false means there is | 458 // Note: In PlzNavigate |cross_navigation_pending_| being false means there is |
nasko
2015/04/15 21:12:45
Since cross_navigation_pending_ is not used in Plz
clamy
2015/04/16 13:18:35
Done.
| |
459 // *no* speculative RenderFrameHost set. | 459 // *no* speculative RenderFrameHost set. |
460 if (!cross_navigation_pending_) { | 460 if (!cross_navigation_pending_ && !speculative_render_frame_host_) { |
461 DCHECK(!speculative_render_frame_host_); | |
462 DCHECK(!pending_render_frame_host_); | 461 DCHECK(!pending_render_frame_host_); |
463 DCHECK_IMPLIES(should_reuse_web_ui_, web_ui_); | 462 DCHECK_IMPLIES(should_reuse_web_ui_, web_ui_); |
464 | 463 |
465 // We should only hear this from our current renderer. | 464 // We should only hear this from our current renderer. |
466 DCHECK_EQ(render_frame_host_, render_frame_host); | 465 DCHECK_EQ(render_frame_host_, render_frame_host); |
467 | 466 |
468 // Even when there is no pending RVH, there may be a pending Web UI. | 467 // Even when there is no pending RVH, there may be a pending Web UI. |
469 if (pending_web_ui() || speculative_web_ui_) | 468 if (pending_web_ui() || speculative_web_ui_) |
470 CommitPending(); | 469 CommitPending(); |
471 return; | 470 return; |
(...skipping 349 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
821 if (!navigation_rfh->IsRenderFrameLive()) { | 820 if (!navigation_rfh->IsRenderFrameLive()) { |
822 // Recreate the opener chain. | 821 // Recreate the opener chain. |
823 int opener_route_id = delegate_->CreateOpenerRenderViewsForRenderManager( | 822 int opener_route_id = delegate_->CreateOpenerRenderViewsForRenderManager( |
824 navigation_rfh->GetSiteInstance()); | 823 navigation_rfh->GetSiteInstance()); |
825 if (!InitRenderView(navigation_rfh->render_view_host(), opener_route_id, | 824 if (!InitRenderView(navigation_rfh->render_view_host(), opener_route_id, |
826 MSG_ROUTING_NONE, frame_tree_node_->IsMainFrame())) { | 825 MSG_ROUTING_NONE, frame_tree_node_->IsMainFrame())) { |
827 return nullptr; | 826 return nullptr; |
828 } | 827 } |
829 } | 828 } |
830 | 829 |
831 cross_navigation_pending_ = navigation_rfh != render_frame_host_.get(); | |
832 return navigation_rfh; | 830 return navigation_rfh; |
833 } | 831 } |
834 | 832 |
835 // PlzNavigate | 833 // PlzNavigate |
836 void RenderFrameHostManager::CleanUpNavigation() { | 834 void RenderFrameHostManager::CleanUpNavigation() { |
837 CHECK(base::CommandLine::ForCurrentProcess()->HasSwitch( | 835 CHECK(base::CommandLine::ForCurrentProcess()->HasSwitch( |
838 switches::kEnableBrowserSideNavigation)); | 836 switches::kEnableBrowserSideNavigation)); |
839 speculative_web_ui_.reset(); | 837 speculative_web_ui_.reset(); |
840 should_reuse_web_ui_ = false; | 838 should_reuse_web_ui_ = false; |
841 if (speculative_render_frame_host_) | 839 if (speculative_render_frame_host_) |
(...skipping 1243 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2085 void RenderFrameHostManager::DeleteRenderFrameProxyHost( | 2083 void RenderFrameHostManager::DeleteRenderFrameProxyHost( |
2086 SiteInstance* instance) { | 2084 SiteInstance* instance) { |
2087 RenderFrameProxyHostMap::iterator iter = proxy_hosts_.find(instance->GetId()); | 2085 RenderFrameProxyHostMap::iterator iter = proxy_hosts_.find(instance->GetId()); |
2088 if (iter != proxy_hosts_.end()) { | 2086 if (iter != proxy_hosts_.end()) { |
2089 delete iter->second; | 2087 delete iter->second; |
2090 proxy_hosts_.erase(iter); | 2088 proxy_hosts_.erase(iter); |
2091 } | 2089 } |
2092 } | 2090 } |
2093 | 2091 |
2094 } // namespace content | 2092 } // namespace content |
OLD | NEW |