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

Side by Side Diff: chrome/browser/net/predictor_api.cc

Issue 5915006: Remove user-related data from local_state and add to user_preferences, i... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: svn pset 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/net/predictor_api.h" 5 #include "chrome/browser/net/predictor_api.h"
6 6
7 #include <map> 7 #include <map>
8 #include <string> 8 #include <string>
9 9
10 #include "base/metrics/field_trial.h" 10 #include "base/metrics/field_trial.h"
(...skipping 375 matching lines...) Expand 10 before | Expand all | Expand 10 after
386 user_prefs->GetBoolean(prefs::kDnsPrefetchingEnabled); 386 user_prefs->GetBoolean(prefs::kDnsPrefetchingEnabled);
387 387
388 // Gather the list of hostnames to prefetch on startup. 388 // Gather the list of hostnames to prefetch on startup.
389 UrlList urls = 389 UrlList urls =
390 GetPredictedUrlListAtStartup(user_prefs, local_state); 390 GetPredictedUrlListAtStartup(user_prefs, local_state);
391 391
392 ListValue* referral_list = 392 ListValue* referral_list =
393 static_cast<ListValue*>(user_prefs->GetMutableList( 393 static_cast<ListValue*>(user_prefs->GetMutableList(
394 prefs::kDnsPrefetchingHostReferralList)->DeepCopy()); 394 prefs::kDnsPrefetchingHostReferralList)->DeepCopy());
395 395
396 // Remove obsolete preferences from local state if necessary.
Ben Goodger (Google) 2011/01/13 22:21:23 ???
Miranda Callahan 2011/01/13 22:29:38 I put this code in predictor_api when I added the
Ben Goodger (Google) 2011/01/13 22:32:56 OK... I am not familiar with this code enough to s
397 int dns_prefs_version =
398 user_prefs->GetInteger(prefs::kMultipleProfilePrefMigration);
399 if (dns_prefs_version < 1) {
400 // These prefs only need to be registered if they need to be cleared from
401 // local state.
402 local_state->RegisterListPref(prefs::kDnsStartupPrefetchList);
403 local_state->RegisterListPref(prefs::kDnsHostReferralList);
404 local_state->ClearPref(prefs::kDnsStartupPrefetchList);
405 local_state->ClearPref(prefs::kDnsHostReferralList);
406 user_prefs->SetInteger(prefs::kMultipleProfilePrefMigration, 1);
407 }
408
409 g_browser_process->io_thread()->InitNetworkPredictor( 396 g_browser_process->io_thread()->InitNetworkPredictor(
410 prefetching_enabled, max_dns_queue_delay, max_parallel_resolves, urls, 397 prefetching_enabled, max_dns_queue_delay, max_parallel_resolves, urls,
411 referral_list, preconnect_enabled); 398 referral_list, preconnect_enabled);
412 } 399 }
413 400
414 void FinalizePredictorInitialization( 401 void FinalizePredictorInitialization(
415 Predictor* global_predictor, 402 Predictor* global_predictor,
416 const UrlList& startup_urls, 403 const UrlList& startup_urls,
417 ListValue* referral_list) { 404 ListValue* referral_list) {
418 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); 405 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
(...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after
625 DCHECK(!g_predictor); 612 DCHECK(!g_predictor);
626 InitNetworkPredictor(max_queueing_delay, max_parallel_resolves, user_prefs, 613 InitNetworkPredictor(max_queueing_delay, max_parallel_resolves, user_prefs,
627 local_state, preconnect_enabled); 614 local_state, preconnect_enabled);
628 } 615 }
629 } 616 }
630 617
631 PredictorInit::~PredictorInit() { 618 PredictorInit::~PredictorInit() {
632 } 619 }
633 620
634 } // namespace chrome_browser_net 621 } // namespace chrome_browser_net
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698