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

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

Issue 279173005: Revert 269798 "Only commit cookie changes in prerenders after a ..." (Closed) Base URL: svn://svn.chromium.org/chrome/
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
Index: trunk/src/chrome/browser/prerender/prerender_manager.cc
===================================================================
--- trunk/src/chrome/browser/prerender/prerender_manager.cc (revision 269811)
+++ trunk/src/chrome/browser/prerender/prerender_manager.cc (working copy)
@@ -58,7 +58,6 @@
#include "content/public/browser/render_process_host.h"
#include "content/public/browser/render_view_host.h"
#include "content/public/browser/session_storage_namespace.h"
-#include "content/public/browser/storage_partition.h"
#include "content/public/browser/web_contents.h"
#include "content/public/browser/web_contents_delegate.h"
#include "content/public/common/url_constants.h"
@@ -246,8 +245,7 @@
prerender_history_(new PrerenderHistory(kHistoryLength)),
histograms_(new PrerenderHistograms()),
profile_network_bytes_(0),
- last_recorded_profile_network_bytes_(0),
- cookie_store_loaded_(false) {
+ last_recorded_profile_network_bytes_(0) {
// There are some assumptions that the PrerenderManager is on the UI thread.
// Any other checks simply make sure that the PrerenderManager is accessed on
// the same thread that it was created on.
@@ -305,13 +303,6 @@
// emptied these vectors already.
DCHECK(active_prerenders_.empty());
DCHECK(to_delete_prerenders_.empty());
-
- for (PrerenderProcessSet::const_iterator it =
- prerender_process_hosts_.begin();
- it != prerender_process_hosts_.end();
- ++it) {
- (*it)->RemoveObserver(this);
- }
}
void PrerenderManager::Shutdown() {
@@ -586,14 +577,6 @@
}
// At this point, we've determined that we will use the prerender.
- content::RenderProcessHost* process_host =
- prerender_data->contents()->GetRenderViewHost()->GetProcess();
- prerender_process_hosts_.erase(process_host);
- BrowserThread::PostTask(
- BrowserThread::IO, FROM_HERE,
- base::Bind(&PrerenderTracker::RemovePrerenderCookieStoreOnIOThread,
- base::Unretained(prerender_tracker()), process_host->GetID(),
- true));
if (!prerender_data->contents()->load_start_time().is_null()) {
histograms_->RecordTimeUntilUsed(
prerender_data->contents()->origin(),
@@ -765,7 +748,7 @@
default:
NOTREACHED() << "Invalid PrerenderManager mode.";
break;
- }
+ };
return "";
}
@@ -1233,12 +1216,6 @@
SortActivePrerenders();
}
-net::URLRequestContextGetter* PrerenderManager::GetURLRequestContext() {
- return content::BrowserContext::GetDefaultStoragePartition(profile_)->
- GetURLRequestContext();
-}
-
-
// private
PrerenderHandle* PrerenderManager::AddPrerender(
Origin origin,
@@ -1303,13 +1280,6 @@
return NULL;
}
- if (!cookie_store_loaded()) {
- // Only prerender if the cookie store for this profile has been loaded.
- // This is required by PrerenderCookieMonster.
- RecordFinalStatus(origin, experiment, FINAL_STATUS_COOKIE_STORE_NOT_LOADED);
- return NULL;
- }
-
PrerenderContents* prerender_contents = CreatePrerenderContents(
url, referrer, origin, experiment);
DCHECK(prerender_contents);
@@ -1334,16 +1304,11 @@
gfx::Size contents_size =
size.IsEmpty() ? config_.default_tab_bounds.size() : size;
- net::URLRequestContextGetter* request_context = GetURLRequestContext();
-
prerender_contents->StartPrerendering(process_id, contents_size,
- session_storage_namespace,
- request_context);
+ session_storage_namespace);
DCHECK(IsControlGroup(experiment) ||
- prerender_contents->prerendering_has_started() ||
- (origin == ORIGIN_LOCAL_PREDICTOR &&
- IsLocalPredictorPrerenderAlwaysControlEnabled()));
+ prerender_contents->prerendering_has_started());
if (GetMode() == PRERENDER_MODE_EXPERIMENT_MULTI_PRERENDER_GROUP)
histograms_->RecordConcurrency(active_prerenders_.size());
@@ -1861,36 +1826,4 @@
profile_network_bytes_ += bytes;
}
-void PrerenderManager::OnCookieStoreLoaded() {
- cookie_store_loaded_ = true;
- if (!on_cookie_store_loaded_cb_for_testing_.is_null())
- on_cookie_store_loaded_cb_for_testing_.Run();
-}
-
-void PrerenderManager::AddPrerenderProcessHost(
- content::RenderProcessHost* process_host) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
- DCHECK(prerender_process_hosts_.find(process_host) ==
- prerender_process_hosts_.end());
- prerender_process_hosts_.insert(process_host);
- process_host->AddObserver(this);
-}
-
-bool PrerenderManager::IsProcessPrerendering(
- content::RenderProcessHost* process_host) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
- return (prerender_process_hosts_.find(process_host) !=
- prerender_process_hosts_.end());
-}
-
-void PrerenderManager::RenderProcessHostDestroyed(
- content::RenderProcessHost* host) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
- prerender_process_hosts_.erase(host);
- BrowserThread::PostTask(
- BrowserThread::IO, FROM_HERE,
- base::Bind(&PrerenderTracker::RemovePrerenderCookieStoreOnIOThread,
- base::Unretained(prerender_tracker()), host->GetID(), false));
-}
-
} // namespace prerender
« no previous file with comments | « trunk/src/chrome/browser/prerender/prerender_manager.h ('k') | trunk/src/chrome/browser/prerender/prerender_tracker.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698