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

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

Issue 293123010: Add a field trial to disable deferred committing of cookie changes (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 6 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
« no previous file with comments | « chrome/browser/prerender/prerender_manager.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/prerender/prerender_manager.cc
===================================================================
--- chrome/browser/prerender/prerender_manager.cc (revision 272804)
+++ chrome/browser/prerender/prerender_manager.cc (working copy)
@@ -1318,7 +1318,7 @@
return NULL;
}
- if (!cookie_store_loaded()) {
+ if (IsPrerenderCookieStoreEnabled() && !cookie_store_loaded()) {
// Only prerender if the cookie store for this profile has been loaded.
// This is required by PrerenderCookieMonster.
RecordFinalStatusWithoutCreatingPrerenderContents(
@@ -1350,7 +1350,8 @@
gfx::Size contents_size =
size.IsEmpty() ? config_.default_tab_bounds.size() : size;
- net::URLRequestContextGetter* request_context = GetURLRequestContext();
+ net::URLRequestContextGetter* request_context =
+ (IsPrerenderCookieStoreEnabled() ? GetURLRequestContext() : NULL);
prerender_contents->StartPrerendering(process_id, contents_size,
session_storage_namespace,
@@ -1897,10 +1898,14 @@
process_host->AddObserver(this);
}
-bool PrerenderManager::IsProcessPrerendering(
+bool PrerenderManager::MayReuseProcessHost(
content::RenderProcessHost* process_host) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
- return (prerender_process_hosts_.find(process_host) !=
+ // If prerender cookie stores are disabled, there is no need to require
+ // isolated prerender processes.
+ if (!IsPrerenderCookieStoreEnabled())
+ return true;
+ return (prerender_process_hosts_.find(process_host) ==
prerender_process_hosts_.end());
}
« no previous file with comments | « chrome/browser/prerender/prerender_manager.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698