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

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

Issue 1213193003: Remove DCHECK_IMPLIES and CHECK_IMPLIES (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 5 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 <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 476 matching lines...) Expand 10 before | Expand all | Expand 10 after
487 487
488 // Make sure any dynamic changes to this frame's sandbox flags that were made 488 // Make sure any dynamic changes to this frame's sandbox flags that were made
489 // prior to navigation take effect. 489 // prior to navigation take effect.
490 CommitPendingSandboxFlags(); 490 CommitPendingSandboxFlags();
491 } 491 }
492 492
493 void RenderFrameHostManager::CommitPendingIfNecessary( 493 void RenderFrameHostManager::CommitPendingIfNecessary(
494 RenderFrameHostImpl* render_frame_host, 494 RenderFrameHostImpl* render_frame_host,
495 bool was_caused_by_user_gesture) { 495 bool was_caused_by_user_gesture) {
496 if (!pending_render_frame_host_ && !speculative_render_frame_host_) { 496 if (!pending_render_frame_host_ && !speculative_render_frame_host_) {
497 DCHECK_IMPLIES(should_reuse_web_ui_, web_ui_); 497 DCHECK(!should_reuse_web_ui_ || web_ui_);
498 498
499 // We should only hear this from our current renderer. 499 // We should only hear this from our current renderer.
500 DCHECK_EQ(render_frame_host_, render_frame_host); 500 DCHECK_EQ(render_frame_host_, render_frame_host);
501 501
502 // Even when there is no pending RVH, there may be a pending Web UI. 502 // Even when there is no pending RVH, there may be a pending Web UI.
503 if (pending_web_ui() || speculative_web_ui_) 503 if (pending_web_ui() || speculative_web_ui_)
504 CommitPending(); 504 CommitPending();
505 return; 505 return;
506 } 506 }
507 507
(...skipping 1006 matching lines...) Expand 10 before | Expand all | Expand 10 after
1514 WebUIImpl* web_ui, 1514 WebUIImpl* web_ui,
1515 int opener_route_id, 1515 int opener_route_id,
1516 int flags, 1516 int flags,
1517 int* view_routing_id_ptr) { 1517 int* view_routing_id_ptr) {
1518 bool swapped_out = !!(flags & CREATE_RF_SWAPPED_OUT); 1518 bool swapped_out = !!(flags & CREATE_RF_SWAPPED_OUT);
1519 bool swapped_out_forbidden = IsSwappedOutStateForbidden(); 1519 bool swapped_out_forbidden = IsSwappedOutStateForbidden();
1520 bool is_site_per_process = base::CommandLine::ForCurrentProcess()->HasSwitch( 1520 bool is_site_per_process = base::CommandLine::ForCurrentProcess()->HasSwitch(
1521 switches::kSitePerProcess); 1521 switches::kSitePerProcess);
1522 1522
1523 CHECK(instance); 1523 CHECK(instance);
1524 CHECK_IMPLIES(swapped_out_forbidden, !swapped_out); 1524 CHECK(!swapped_out_forbidden || !swapped_out);
1525 CHECK_IMPLIES(!is_site_per_process, frame_tree_node_->IsMainFrame()); 1525 CHECK(is_site_per_process || frame_tree_node_->IsMainFrame());
1526 1526
1527 // Swapped out views should always be hidden. 1527 // Swapped out views should always be hidden.
1528 DCHECK_IMPLIES(swapped_out, (flags & CREATE_RF_HIDDEN)); 1528 DCHECK(!swapped_out || (flags & CREATE_RF_HIDDEN));
1529 1529
1530 scoped_ptr<RenderFrameHostImpl> new_render_frame_host; 1530 scoped_ptr<RenderFrameHostImpl> new_render_frame_host;
1531 bool success = true; 1531 bool success = true;
1532 if (view_routing_id_ptr) 1532 if (view_routing_id_ptr)
1533 *view_routing_id_ptr = MSG_ROUTING_NONE; 1533 *view_routing_id_ptr = MSG_ROUTING_NONE;
1534 1534
1535 // We are creating a pending, speculative or swapped out RFH here. We should 1535 // We are creating a pending, speculative or swapped out RFH here. We should
1536 // never create it in the same SiteInstance as our current RFH. 1536 // never create it in the same SiteInstance as our current RFH.
1537 CHECK_NE(render_frame_host_->GetSiteInstance(), instance); 1537 CHECK_NE(render_frame_host_->GetSiteInstance(), instance);
1538 1538
(...skipping 775 matching lines...) Expand 10 before | Expand all | Expand 10 after
2314 frame_tree->root()->render_manager()-> 2314 frame_tree->root()->render_manager()->
2315 CreateRenderFrame(instance, nullptr, opener_route_id, 2315 CreateRenderFrame(instance, nullptr, opener_route_id,
2316 CREATE_RF_FOR_MAIN_FRAME_NAVIGATION | 2316 CREATE_RF_FOR_MAIN_FRAME_NAVIGATION |
2317 CREATE_RF_SWAPPED_OUT | CREATE_RF_HIDDEN, 2317 CREATE_RF_SWAPPED_OUT | CREATE_RF_HIDDEN,
2318 &render_view_routing_id); 2318 &render_view_routing_id);
2319 } 2319 }
2320 return render_view_routing_id; 2320 return render_view_routing_id;
2321 } 2321 }
2322 2322
2323 } // namespace content 2323 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/frame_host/render_frame_host_impl.cc ('k') | content/browser/frame_host/render_frame_proxy_host.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698