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

Unified Diff: chrome/browser/tab_contents/tab_contents.cc

Issue 6288007: Prerendering for redirects -- part 2.... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years, 11 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/tab_contents/tab_contents.cc
===================================================================
--- chrome/browser/tab_contents/tab_contents.cc (revision 71719)
+++ chrome/browser/tab_contents/tab_contents.cc (working copy)
@@ -1635,6 +1635,17 @@
if (!is_error_page)
content_settings_delegate_->ClearCookieSpecificContentSettings();
content_settings_delegate_->ClearGeolocationContentSettings();
+
+ // Check if the URL we are about to load has been prerendered by any chance,
+ // and use it if possible.
+ PrerenderManager* pm = profile()->GetPrerenderManager();
cbentzel 2011/01/19 17:08:03 This block of code is now repeated three times - m
tburkard 2011/01/19 19:00:45 Done.
+ if (pm != NULL) {
+ if (pm->MaybeUsePreloadedPage(this, url)) {
+ // TODO(tburkard): If the preloaded page has not finished preloading
+ // yet, we should not do this.
+ DidStopLoading();
+ }
+ }
}
}
@@ -1649,6 +1660,17 @@
if (!entry || entry->url() != source_url)
return;
entry->set_url(target_url);
+
+ // Check if the URL we are about to load has been prerendered by any chance,
+ // and use it if possible.
+ PrerenderManager* pm = profile()->GetPrerenderManager();
+ if (pm != NULL) {
+ if (pm->MaybeUsePreloadedPage(this, target_url)) {
+ // TODO(tburkard): If the preloaded page has not finished preloading
+ // yet, we should not do this.
+ DidStopLoading();
+ }
+ }
}
void TabContents::OnDidFailProvisionalLoadWithError(
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698