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

Unified Diff: chrome/browser/instant/instant_loader.cc

Issue 7034043: Prerender/Instant interopability. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 7 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/instant/instant_loader.cc
diff --git a/chrome/browser/instant/instant_loader.cc b/chrome/browser/instant/instant_loader.cc
index f686ecb88928eca1229c996078012340a2a1c702..12deb9b960f978a223cf7158612c1124dcda9d4f 100644
--- a/chrome/browser/instant/instant_loader.cc
+++ b/chrome/browser/instant/instant_loader.cc
@@ -139,6 +139,19 @@ void InstantLoader::FrameLoadObserver::Observe(
}
}
+// If this is being called, something is swapping in to our preview_contents_
+// before we've added it to the tab strip.
+void InstantLoader::SwapTabContents(TabContentsWrapper* old_tc,
+ TabContentsWrapper* new_tc) {
+ DCHECK(old_tc == preview_contents_);
+ // We release here without deleting so that the caller still has reponsibility
+ // for deleting the TabContentsWrapper. The (void) cast is so that we use the
+ // returned value.
+ TabContentsWrapper* tab_contents_wrapper = preview_contents_.release();
sky 2011/05/19 19:53:55 ignore_result
dominich 2011/05/19 23:57:28 Done.
+ (void) tab_contents_wrapper;
+ preview_contents_.reset(new_tc);
sky 2011/05/19 19:53:55 I'm not sure under when this might be invoked. Cou
dominich 2011/05/19 23:57:28 It's invoked if the InstantLoader is the delegate
+}
+
// TabContentsDelegateImpl -----------------------------------------------------
class InstantLoader::TabContentsDelegateImpl
@@ -996,6 +1009,7 @@ void InstantLoader::CreatePreviewContents(TabContentsWrapper* tab_contents) {
new TabContents(
tab_contents->profile(), NULL, MSG_ROUTING_NONE, NULL, NULL);
preview_contents_.reset(new TabContentsWrapper(new_contents));
+ preview_contents_->set_delegate(this);
preview_contents_->blocked_content_tab_helper()->SetAllContentsBlocked(true);
// Propagate the max page id. That way if we end up merging the two
// NavigationControllers (which happens if we commit) none of the page ids

Powered by Google App Engine
This is Rietveld 408576698