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

Unified Diff: chrome/browser/prerender/prerender_tab_helper.cc

Issue 9623018: Prerendered pages are swapped in at browser::Navigate time. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/prerender/prerender_tab_helper.cc
diff --git a/chrome/browser/prerender/prerender_tab_helper.cc b/chrome/browser/prerender/prerender_tab_helper.cc
index badb85c189c05ac13d800582cb04ded23f9935e6..12524a11bea5b1b551bf65f55fee9706e51e18c7 100644
--- a/chrome/browser/prerender/prerender_tab_helper.cc
+++ b/chrome/browser/prerender/prerender_tab_helper.cc
@@ -184,15 +184,12 @@ void PrerenderTabHelper::ProvisionalChangeToMainFrameUrl(
RecordPageviewEvent(PAGEVIEW_EVENT_NEW_URL);
if (IsTopSite(url))
RecordPageviewEvent(PAGEVIEW_EVENT_TOP_SITE_NEW_URL);
- if (!tab_->core_tab_helper()->delegate())
- return; // PrerenderManager needs a delegate to handle the swap.
PrerenderManager* prerender_manager = MaybeGetPrerenderManager();
if (!prerender_manager)
return;
if (prerender_manager->IsWebContentsPrerendering(web_contents()))
return;
prerender_manager->MarkWebContentsAsNotPrerendered(web_contents());
- MaybeUsePrerenderedPage(url, opener_url);
}
void PrerenderTabHelper::UpdateTargetURL(int32 page_id, const GURL& url) {
@@ -247,17 +244,6 @@ PrerenderManager* PrerenderTabHelper::MaybeGetPrerenderManager() const {
Profile::FromBrowserContext(web_contents()->GetBrowserContext()));
}
-bool PrerenderTabHelper::MaybeUsePrerenderedPage(const GURL& url,
- const GURL& opener_url) {
- PrerenderManager* prerender_manager = MaybeGetPrerenderManager();
- if (!prerender_manager)
- return false;
- DCHECK(!prerender_manager->IsWebContentsPrerendering(web_contents()));
- return prerender_manager->MaybeUsePrerenderedPage(web_contents(),
- url,
- opener_url);
-}
-
bool PrerenderTabHelper::IsPrerendering() {
PrerenderManager* prerender_manager = MaybeGetPrerenderManager();
if (!prerender_manager)

Powered by Google App Engine
This is Rietveld 408576698