Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(63)

Side by Side Diff: content/browser/frame_host/render_frame_host_manager.cc

Issue 1421483005: Reland: Remove DCHECK_IMPLIES/CHECK_IMPLIES. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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_IMPLIES(should_reuse_web_ui_, web_ui_); 674 DCHECK(!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 1065 matching lines...) Expand 10 before | Expand all | Expand 10 after
1750 scoped_ptr<RenderFrameHostImpl> RenderFrameHostManager::CreateRenderFrame( 1750 scoped_ptr<RenderFrameHostImpl> RenderFrameHostManager::CreateRenderFrame(
1751 SiteInstance* instance, 1751 SiteInstance* instance,
1752 WebUIImpl* web_ui, 1752 WebUIImpl* web_ui,
1753 int flags, 1753 int flags,
1754 int* view_routing_id_ptr) { 1754 int* view_routing_id_ptr) {
1755 bool swapped_out = !!(flags & CREATE_RF_SWAPPED_OUT); 1755 bool swapped_out = !!(flags & CREATE_RF_SWAPPED_OUT);
1756 bool swapped_out_forbidden = 1756 bool swapped_out_forbidden =
1757 SiteIsolationPolicy::IsSwappedOutStateForbidden(); 1757 SiteIsolationPolicy::IsSwappedOutStateForbidden();
1758 1758
1759 CHECK(instance); 1759 CHECK(instance);
1760 CHECK_IMPLIES(swapped_out_forbidden, !swapped_out); 1760 CHECK(!swapped_out_forbidden || !swapped_out);
1761 CHECK_IMPLIES(!SiteIsolationPolicy::AreCrossProcessFramesPossible(), 1761 CHECK(SiteIsolationPolicy::AreCrossProcessFramesPossible() ||
1762 frame_tree_node_->IsMainFrame()); 1762 frame_tree_node_->IsMainFrame());
1763 1763
1764 // Swapped out views should always be hidden. 1764 // Swapped out views should always be hidden.
1765 DCHECK_IMPLIES(swapped_out, (flags & CREATE_RF_HIDDEN)); 1765 DCHECK(!swapped_out || (flags & CREATE_RF_HIDDEN));
1766 1766
1767 scoped_ptr<RenderFrameHostImpl> new_render_frame_host; 1767 scoped_ptr<RenderFrameHostImpl> new_render_frame_host;
1768 bool success = true; 1768 bool success = true;
1769 if (view_routing_id_ptr) 1769 if (view_routing_id_ptr)
1770 *view_routing_id_ptr = MSG_ROUTING_NONE; 1770 *view_routing_id_ptr = MSG_ROUTING_NONE;
1771 1771
1772 // We are creating a pending, speculative or swapped out RFH here. We should 1772 // We are creating a pending, speculative or swapped out RFH here. We should
1773 // never create it in the same SiteInstance as our current RFH. 1773 // never create it in the same SiteInstance as our current RFH.
1774 CHECK_NE(render_frame_host_->GetSiteInstance(), instance); 1774 CHECK_NE(render_frame_host_->GetSiteInstance(), instance);
1775 1775
(...skipping 872 matching lines...) Expand 10 before | Expand all | Expand 10 after
2648 int RenderFrameHostManager::GetOpenerRoutingID(SiteInstance* instance) { 2648 int RenderFrameHostManager::GetOpenerRoutingID(SiteInstance* instance) {
2649 if (!frame_tree_node_->opener()) 2649 if (!frame_tree_node_->opener())
2650 return MSG_ROUTING_NONE; 2650 return MSG_ROUTING_NONE;
2651 2651
2652 return frame_tree_node_->opener() 2652 return frame_tree_node_->opener()
2653 ->render_manager() 2653 ->render_manager()
2654 ->GetRoutingIdForSiteInstance(instance); 2654 ->GetRoutingIdForSiteInstance(instance);
2655 } 2655 }
2656 2656
2657 } // namespace content 2657 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698