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 <algorithm> | 7 #include <algorithm> |
8 #include <utility> | 8 #include <utility> |
9 | 9 |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 653 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
664 | 664 |
665 // Make sure any dynamic changes to this frame's sandbox flags that were made | 665 // Make sure any dynamic changes to this frame's sandbox flags that were made |
666 // prior to navigation take effect. | 666 // prior to navigation take effect. |
667 CommitPendingSandboxFlags(); | 667 CommitPendingSandboxFlags(); |
668 } | 668 } |
669 | 669 |
670 void RenderFrameHostManager::CommitPendingIfNecessary( | 670 void RenderFrameHostManager::CommitPendingIfNecessary( |
671 RenderFrameHostImpl* render_frame_host, | 671 RenderFrameHostImpl* render_frame_host, |
672 bool was_caused_by_user_gesture) { | 672 bool was_caused_by_user_gesture) { |
673 if (!pending_render_frame_host_ && !speculative_render_frame_host_) { | 673 if (!pending_render_frame_host_ && !speculative_render_frame_host_) { |
674 DCHECK(!should_reuse_web_ui_ || web_ui_); | 674 DCHECK_IMPLIES(should_reuse_web_ui_, web_ui_); |
675 | 675 |
676 // We should only hear this from our current renderer. | 676 // We should only hear this from our current renderer. |
677 DCHECK_EQ(render_frame_host_, render_frame_host); | 677 DCHECK_EQ(render_frame_host_, render_frame_host); |
678 | 678 |
679 // Even when there is no pending RVH, there may be a pending Web UI. | 679 // Even when there is no pending RVH, there may be a pending Web UI. |
680 if (pending_web_ui() || speculative_web_ui_) | 680 if (pending_web_ui() || speculative_web_ui_) |
681 CommitPending(); | 681 CommitPending(); |
682 return; | 682 return; |
683 } | 683 } |
684 | 684 |
(...skipping 1078 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1763 scoped_ptr<RenderFrameHostImpl> RenderFrameHostManager::CreateRenderFrame( | 1763 scoped_ptr<RenderFrameHostImpl> RenderFrameHostManager::CreateRenderFrame( |
1764 SiteInstance* instance, | 1764 SiteInstance* instance, |
1765 WebUIImpl* web_ui, | 1765 WebUIImpl* web_ui, |
1766 int flags, | 1766 int flags, |
1767 int* view_routing_id_ptr) { | 1767 int* view_routing_id_ptr) { |
1768 bool swapped_out = !!(flags & CREATE_RF_SWAPPED_OUT); | 1768 bool swapped_out = !!(flags & CREATE_RF_SWAPPED_OUT); |
1769 bool swapped_out_forbidden = | 1769 bool swapped_out_forbidden = |
1770 SiteIsolationPolicy::IsSwappedOutStateForbidden(); | 1770 SiteIsolationPolicy::IsSwappedOutStateForbidden(); |
1771 | 1771 |
1772 CHECK(instance); | 1772 CHECK(instance); |
1773 CHECK(!swapped_out_forbidden || !swapped_out); | 1773 CHECK_IMPLIES(swapped_out_forbidden, !swapped_out); |
1774 CHECK(SiteIsolationPolicy::AreCrossProcessFramesPossible() || | 1774 CHECK_IMPLIES(!SiteIsolationPolicy::AreCrossProcessFramesPossible(), |
1775 frame_tree_node_->IsMainFrame()); | 1775 frame_tree_node_->IsMainFrame()); |
1776 | 1776 |
1777 // Swapped out views should always be hidden. | 1777 // Swapped out views should always be hidden. |
1778 DCHECK(!swapped_out || (flags & CREATE_RF_HIDDEN)); | 1778 DCHECK_IMPLIES(swapped_out, (flags & CREATE_RF_HIDDEN)); |
1779 | 1779 |
1780 scoped_ptr<RenderFrameHostImpl> new_render_frame_host; | 1780 scoped_ptr<RenderFrameHostImpl> new_render_frame_host; |
1781 bool success = true; | 1781 bool success = true; |
1782 if (view_routing_id_ptr) | 1782 if (view_routing_id_ptr) |
1783 *view_routing_id_ptr = MSG_ROUTING_NONE; | 1783 *view_routing_id_ptr = MSG_ROUTING_NONE; |
1784 | 1784 |
1785 // We are creating a pending, speculative or swapped out RFH here. We should | 1785 // We are creating a pending, speculative or swapped out RFH here. We should |
1786 // never create it in the same SiteInstance as our current RFH. | 1786 // never create it in the same SiteInstance as our current RFH. |
1787 CHECK_NE(render_frame_host_->GetSiteInstance(), instance); | 1787 CHECK_NE(render_frame_host_->GetSiteInstance(), instance); |
1788 | 1788 |
(...skipping 872 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2661 int RenderFrameHostManager::GetOpenerRoutingID(SiteInstance* instance) { | 2661 int RenderFrameHostManager::GetOpenerRoutingID(SiteInstance* instance) { |
2662 if (!frame_tree_node_->opener()) | 2662 if (!frame_tree_node_->opener()) |
2663 return MSG_ROUTING_NONE; | 2663 return MSG_ROUTING_NONE; |
2664 | 2664 |
2665 return frame_tree_node_->opener() | 2665 return frame_tree_node_->opener() |
2666 ->render_manager() | 2666 ->render_manager() |
2667 ->GetRoutingIdForSiteInstance(instance); | 2667 ->GetRoutingIdForSiteInstance(instance); |
2668 } | 2668 } |
2669 | 2669 |
2670 } // namespace content | 2670 } // namespace content |
OLD | NEW |