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

Side by Side Diff: chrome/browser/profiles/profile_impl.cc

Issue 64193003: Clean up PrefServiceBuilder (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix memory ownership bug in ProxyPolicyTest Created 7 years, 1 month 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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/profiles/profile_impl.h" 5 #include "chrome/browser/profiles/profile_impl.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/callback.h" 8 #include "base/callback.h"
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/compiler_specific.h" 10 #include "base/compiler_specific.h"
(...skipping 429 matching lines...) Expand 10 before | Expand all | Expand 10 after
440 ManagedUserSettingsServiceFactory::GetForProfile(this); 440 ManagedUserSettingsServiceFactory::GetForProfile(this);
441 managed_user_settings->Init( 441 managed_user_settings->Init(
442 path_, sequenced_task_runner, create_mode == CREATE_MODE_SYNCHRONOUS); 442 path_, sequenced_task_runner, create_mode == CREATE_MODE_SYNCHRONOUS);
443 #endif 443 #endif
444 444
445 { 445 {
446 // On startup, preference loading is always synchronous so a scoped timer 446 // On startup, preference loading is always synchronous so a scoped timer
447 // will work here. 447 // will work here.
448 startup_metric_utils::ScopedSlowStartupUMA 448 startup_metric_utils::ScopedSlowStartupUMA
449 scoped_timer("Startup.SlowStartupPreferenceLoading"); 449 scoped_timer("Startup.SlowStartupPreferenceLoading");
450 prefs_.reset(chrome_prefs::CreateProfilePrefs( 450 prefs_ = chrome_prefs::CreateProfilePrefs(
451 GetPrefFilePath(), 451 GetPrefFilePath(),
452 sequenced_task_runner, 452 sequenced_task_runner,
453 profile_policy_connector_->policy_service(), 453 profile_policy_connector_->policy_service(),
454 managed_user_settings, 454 managed_user_settings,
455 new ExtensionPrefStore( 455 new ExtensionPrefStore(
456 ExtensionPrefValueMapFactory::GetForBrowserContext(this), false), 456 ExtensionPrefValueMapFactory::GetForBrowserContext(this), false),
457 pref_registry_, 457 pref_registry_,
458 async_prefs)); 458 async_prefs).Pass();
459 // Register on BrowserContext. 459 // Register on BrowserContext.
460 user_prefs::UserPrefs::Set(this, prefs_.get()); 460 user_prefs::UserPrefs::Set(this, prefs_.get());
461 } 461 }
462 462
463 startup_metric_utils::ScopedSlowStartupUMA 463 startup_metric_utils::ScopedSlowStartupUMA
464 scoped_timer("Startup.SlowStartupFinalProfileInit"); 464 scoped_timer("Startup.SlowStartupFinalProfileInit");
465 if (async_prefs) { 465 if (async_prefs) {
466 // Wait for the notification that prefs has been loaded 466 // Wait for the notification that prefs has been loaded
467 // (successfully or not). Note that we can use base::Unretained 467 // (successfully or not). Note that we can use base::Unretained
468 // because the PrefService is owned by this class and lives on 468 // because the PrefService is owned by this class and lives on
(...skipping 772 matching lines...) Expand 10 before | Expand all | Expand 10 after
1241 PrefProxyConfigTracker* ProfileImpl::CreateProxyConfigTracker() { 1241 PrefProxyConfigTracker* ProfileImpl::CreateProxyConfigTracker() {
1242 #if defined(OS_CHROMEOS) 1242 #if defined(OS_CHROMEOS)
1243 if (chromeos::ProfileHelper::IsSigninProfile(this)) { 1243 if (chromeos::ProfileHelper::IsSigninProfile(this)) {
1244 return ProxyServiceFactory::CreatePrefProxyConfigTrackerOfLocalState( 1244 return ProxyServiceFactory::CreatePrefProxyConfigTrackerOfLocalState(
1245 g_browser_process->local_state()); 1245 g_browser_process->local_state());
1246 } 1246 }
1247 #endif // defined(OS_CHROMEOS) 1247 #endif // defined(OS_CHROMEOS)
1248 return ProxyServiceFactory::CreatePrefProxyConfigTrackerOfProfile( 1248 return ProxyServiceFactory::CreatePrefProxyConfigTrackerOfProfile(
1249 GetPrefs(), g_browser_process->local_state()); 1249 GetPrefs(), g_browser_process->local_state());
1250 } 1250 }
OLDNEW
« no previous file with comments | « chrome/browser/prefs/proxy_policy_unittest.cc ('k') | chrome/browser/ui/app_list/app_list_service_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698