| Index: chrome/browser/net/predictor.cc
|
| diff --git a/chrome/browser/net/predictor.cc b/chrome/browser/net/predictor.cc
|
| index e81f4a83101834554d2121c676e51f18e02149f3..4e9440a831f780e7e7e3d4210ae541c915c33a18 100644
|
| --- a/chrome/browser/net/predictor.cc
|
| +++ b/chrome/browser/net/predictor.cc
|
| @@ -157,16 +157,8 @@ void Predictor::InitNetworkPredictor(PrefService* user_prefs,
|
| // Gather the list of hostnames to prefetch on startup.
|
| std::vector<GURL> urls = GetPredictedUrlListAtStartup(user_prefs);
|
|
|
| - base::ListValue* referral_list =
|
| - static_cast<base::ListValue*>(user_prefs->GetList(
|
| - prefs::kDnsPrefetchingHostReferralList)->DeepCopy());
|
| -
|
| - // Now that we have the statistics in memory, wipe them from the Preferences
|
| - // file. They will be serialized back on a clean shutdown. This way we only
|
| - // have to worry about clearing our in-memory state when Clearing Browsing
|
| - // Data.
|
| - user_prefs->ClearPref(prefs::kDnsPrefetchingStartupList);
|
| - user_prefs->ClearPref(prefs::kDnsPrefetchingHostReferralList);
|
| + const base::ListValue* referral_list =
|
| + user_prefs->GetList(prefs::kDnsPrefetchingHostReferralList);
|
|
|
| BrowserThread::PostTask(
|
| BrowserThread::IO,
|
| @@ -626,12 +618,6 @@ void Predictor::DeserializeReferrers(const base::ListValue& referral_list) {
|
| }
|
| }
|
|
|
| -void Predictor::DeserializeReferrersThenDelete(
|
| - base::ListValue* referral_list) {
|
| - DeserializeReferrers(*referral_list);
|
| - delete referral_list;
|
| -}
|
| -
|
| void Predictor::DiscardInitialNavigationHistory() {
|
| DCHECK_CURRENTLY_ON(BrowserThread::IO);
|
| if (initial_observer_.get())
|
| @@ -640,7 +626,7 @@ void Predictor::DiscardInitialNavigationHistory() {
|
|
|
| void Predictor::FinalizeInitializationOnIOThread(
|
| const std::vector<GURL>& startup_urls,
|
| - base::ListValue* referral_list,
|
| + const base::ListValue* referral_list,
|
| IOThread* io_thread,
|
| ProfileIOData* profile_io_data) {
|
| DCHECK_CURRENTLY_ON(BrowserThread::IO);
|
| @@ -664,7 +650,7 @@ void Predictor::FinalizeInitializationOnIOThread(
|
| // Prefetch these hostnames on startup.
|
| DnsPrefetchMotivatedList(startup_urls, UrlInfo::STARTUP_LIST_MOTIVATED);
|
|
|
| - DeserializeReferrersThenDelete(referral_list);
|
| + DeserializeReferrers(*referral_list);
|
|
|
| LogStartupMetrics();
|
| }
|
| @@ -912,6 +898,12 @@ bool Predictor::CanPreresolveAndPreconnect() const {
|
| }
|
| }
|
|
|
| +void Predictor::ClearPrefsOnUIThread() {
|
| + DCHECK_CURRENTLY_ON(BrowserThread::UI);
|
| + user_prefs_->ClearPref(prefs::kDnsPrefetchingStartupList);
|
| + user_prefs_->ClearPref(prefs::kDnsPrefetchingHostReferralList);
|
| +}
|
| +
|
| enum SubresourceValue {
|
| PRECONNECTION,
|
| PRERESOLUTION,
|
|
|