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

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

Issue 196133032: Add test for filtering of IPC messages when RenderFrameHost is swapped out. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixing url_chain and comment. Created 6 years, 9 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 | Annotate | Revision Log
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/debug/trace_event.h" 10 #include "base/debug/trace_event.h"
(...skipping 449 matching lines...) Expand 10 before | Expand all | Expand 10 after
460 // Even when there is no pending RVH, there may be a pending Web UI. 460 // Even when there is no pending RVH, there may be a pending Web UI.
461 if (pending_web_ui()) 461 if (pending_web_ui())
462 CommitPending(); 462 CommitPending();
463 return; 463 return;
464 } 464 }
465 465
466 if (render_frame_host == pending_render_frame_host_) { 466 if (render_frame_host == pending_render_frame_host_) {
467 // The pending cross-site navigation completed, so show the renderer. 467 // The pending cross-site navigation completed, so show the renderer.
468 // If it committed without sending network requests (e.g., data URLs), 468 // If it committed without sending network requests (e.g., data URLs),
469 // then we still need to swap out the old RFH first and run its unload 469 // then we still need to swap out the old RFH first and run its unload
470 // handler. OK for that to happen in the background. 470 // handler, only if it hasn't happened yet. OK for that to happen in the
471 // background.
471 if (pending_render_frame_host_->render_view_host()-> 472 if (pending_render_frame_host_->render_view_host()->
472 HasPendingCrossSiteRequest()) 473 HasPendingCrossSiteRequest() &&
474 pending_render_frame_host_->render_view_host()->rvh_state() ==
475 RenderViewHostImpl::STATE_DEFAULT) {
473 SwapOutOldPage(); 476 SwapOutOldPage();
477 }
474 478
475 CommitPending(); 479 CommitPending();
476 cross_navigation_pending_ = false; 480 cross_navigation_pending_ = false;
477 } else if (render_frame_host == render_frame_host_) { 481 } else if (render_frame_host == render_frame_host_) {
478 // A navigation in the original page has taken place. Cancel the pending 482 // A navigation in the original page has taken place. Cancel the pending
479 // one. 483 // one.
480 CancelPending(); 484 CancelPending();
481 cross_navigation_pending_ = false; 485 cross_navigation_pending_ = false;
482 } else { 486 } else {
483 // No one else should be sending us DidNavigate in this state. 487 // No one else should be sending us DidNavigate in this state.
(...skipping 975 matching lines...) Expand 10 before | Expand all | Expand 10 after
1459 SiteInstance* instance) const { 1463 SiteInstance* instance) const {
1460 RenderFrameHostMap::const_iterator iter = 1464 RenderFrameHostMap::const_iterator iter =
1461 swapped_out_hosts_.find(instance->GetId()); 1465 swapped_out_hosts_.find(instance->GetId());
1462 if (iter != swapped_out_hosts_.end()) 1466 if (iter != swapped_out_hosts_.end())
1463 return iter->second; 1467 return iter->second;
1464 1468
1465 return NULL; 1469 return NULL;
1466 } 1470 }
1467 1471
1468 } // namespace content 1472 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698