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

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

Issue 7649009: Merge of 97624 to 835 branch. (Closed) Base URL: svn://svn.chromium.org/chrome/branches/835/src/
Patch Set: 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/prerender/prerender_contents.h ('k') | chrome/browser/prerender/prerender_final_status.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/prerender/prerender_contents.cc
===================================================================
--- chrome/browser/prerender/prerender_contents.cc (revision 96734)
+++ chrome/browser/prerender/prerender_contents.cc (working copy)
@@ -87,17 +87,27 @@
return false;
}
- bool CanDownload(TabContents* source, int request_id) OVERRIDE {
+ virtual bool CanDownload(TabContents* source, int request_id) OVERRIDE {
prerender_contents_->Destroy(FINAL_STATUS_DOWNLOAD);
// Cancel the download.
return false;
}
- void OnStartDownload(TabContents* source, DownloadItem* download) OVERRIDE {
+ virtual void OnStartDownload(TabContents* source,
+ DownloadItem* download) OVERRIDE {
// Prerendered pages should never be able to download files.
NOTREACHED();
}
+ virtual bool OnGoToEntryOffset(int offset) OVERRIDE {
+ // This isn't allowed because the history merge operation
+ // does not work if there are renderer issued challenges.
+ // TODO(cbentzel): Cancel in this case? May not need to do
+ // since render-issued offset navigations are not guaranteed,
+ // but indicates that the page cares about the history.
+ return false;
+ }
+
// Commits the History of Pages to the given TabContents.
void CommitHistory(TabContentsWrapper* tab) {
for (size_t i = 0; i < add_page_vector_.size(); ++i)
@@ -601,4 +611,13 @@
return dict_value;
}
+bool PrerenderContents::IsCrossSiteNavigationPending() const {
+ if (!prerender_contents_.get() || !prerender_contents_->tab_contents())
+ return false;
+ const TabContents* tab_contents = prerender_contents_->tab_contents();
+ return (tab_contents->GetSiteInstance() !=
+ tab_contents->GetPendingSiteInstance());
+}
+
+
} // namespace prerender
« no previous file with comments | « chrome/browser/prerender/prerender_contents.h ('k') | chrome/browser/prerender/prerender_final_status.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698