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

Side by Side Diff: content/browser/tab_contents/render_view_host_manager.cc

Issue 7618016: Additional fixes for prerender/instant + browsing history. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Checks for pending_render_view_host_ Created 9 years, 4 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 (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/tab_contents/render_view_host_manager.h" 5 #include "content/browser/tab_contents/render_view_host_manager.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "content/browser/content_browser_client.h" 9 #include "content/browser/content_browser_client.h"
10 #include "content/browser/renderer_host/render_view_host.h" 10 #include "content/browser/renderer_host/render_view_host.h"
(...skipping 646 matching lines...) Expand 10 before | Expand all | Expand 10 after
657 } 657 }
658 658
659 // This will possibly create (set to NULL) a Web UI object for the pending 659 // This will possibly create (set to NULL) a Web UI object for the pending
660 // page. We'll use this later to give the page special access. This must 660 // page. We'll use this later to give the page special access. This must
661 // happen before the new renderer is created below so it will get bindings. 661 // happen before the new renderer is created below so it will get bindings.
662 // It must also happen after the above conditional call to CancelPending(), 662 // It must also happen after the above conditional call to CancelPending(),
663 // otherwise CancelPending may clear the pending_web_ui_ and the page will 663 // otherwise CancelPending may clear the pending_web_ui_ and the page will
664 // not have it's bindings set appropriately. 664 // not have it's bindings set appropriately.
665 pending_web_ui_.reset(delegate_->CreateWebUIForRenderManager(entry.url())); 665 pending_web_ui_.reset(delegate_->CreateWebUIForRenderManager(entry.url()));
666 666
667 // render_view_host_ will not be deleted before the end of this method, so we 667 // render_view_host_ willz not be deleted before the end of this method, so we
Charlie Reis 2011/08/13 18:39:24 Typo
cbentzel 2011/08/13 21:24:28 Done.
668 // don't have to worry about this SiteInstance's ref count dropping to zero. 668 // don't have to worry about this SiteInstance's ref count dropping to zero.
669 SiteInstance* curr_instance = render_view_host_->site_instance(); 669 SiteInstance* curr_instance = render_view_host_->site_instance();
670 670
671 // Determine if we need a new SiteInstance for this entry. 671 // Determine if we need a new SiteInstance for this entry.
672 // Again, new_instance won't be deleted before the end of this method, so it 672 // Again, new_instance won't be deleted before the end of this method, so it
673 // is safe to use a normal pointer here. 673 // is safe to use a normal pointer here.
674 SiteInstance* new_instance = curr_instance; 674 SiteInstance* new_instance = curr_instance;
675 bool force_swap = ShouldSwapProcessesForNavigation( 675 bool force_swap = ShouldSwapProcessesForNavigation(
676 delegate_->GetLastCommittedNavigationEntryForRenderManager(), &entry); 676 delegate_->GetLastCommittedNavigationEntryForRenderManager(), &entry);
677 if (ShouldTransitionCrossSite() || force_swap) 677 if (ShouldTransitionCrossSite() || force_swap)
(...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after
866 delegate_->NotifySwappedFromRenderManager(); 866 delegate_->NotifySwappedFromRenderManager();
867 } 867 }
868 868
869 bool RenderViewHostManager::IsSwappedOut(RenderViewHost* rvh) { 869 bool RenderViewHostManager::IsSwappedOut(RenderViewHost* rvh) {
870 if (!rvh->site_instance()) 870 if (!rvh->site_instance())
871 return false; 871 return false;
872 872
873 return swapped_out_hosts_.find(rvh->site_instance()->id()) != 873 return swapped_out_hosts_.find(rvh->site_instance()->id()) !=
874 swapped_out_hosts_.end(); 874 swapped_out_hosts_.end();
875 } 875 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698