| OLD | NEW |
| 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 395 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 406 scoped_timer("Startup.SlowStartupPreferenceLoading"); | 406 scoped_timer("Startup.SlowStartupPreferenceLoading"); |
| 407 prefs_.reset(chrome_prefs::CreateProfilePrefs( | 407 prefs_.reset(chrome_prefs::CreateProfilePrefs( |
| 408 GetPrefFilePath(), | 408 GetPrefFilePath(), |
| 409 sequenced_task_runner, | 409 sequenced_task_runner, |
| 410 profile_policy_connector_->policy_service(), | 410 profile_policy_connector_->policy_service(), |
| 411 new ExtensionPrefStore( | 411 new ExtensionPrefStore( |
| 412 ExtensionPrefValueMapFactory::GetForProfile(this), false), | 412 ExtensionPrefValueMapFactory::GetForProfile(this), false), |
| 413 pref_registry_, | 413 pref_registry_, |
| 414 async_prefs)); | 414 async_prefs)); |
| 415 // Register on BrowserContext. | 415 // Register on BrowserContext. |
| 416 components::UserPrefs::Set(this, prefs_.get()); | 416 user_prefs::UserPrefs::Set(this, prefs_.get()); |
| 417 } | 417 } |
| 418 | 418 |
| 419 startup_metric_utils::ScopedSlowStartupUMA | 419 startup_metric_utils::ScopedSlowStartupUMA |
| 420 scoped_timer("Startup.SlowStartupFinalProfileInit"); | 420 scoped_timer("Startup.SlowStartupFinalProfileInit"); |
| 421 if (async_prefs) { | 421 if (async_prefs) { |
| 422 // Wait for the notification that prefs has been loaded | 422 // Wait for the notification that prefs has been loaded |
| 423 // (successfully or not). Note that we can use base::Unretained | 423 // (successfully or not). Note that we can use base::Unretained |
| 424 // because the PrefService is owned by this class and lives on | 424 // because the PrefService is owned by this class and lives on |
| 425 // the same thread. | 425 // the same thread. |
| 426 prefs_->AddPrefInitObserver(base::Bind(&ProfileImpl::OnPrefsLoaded, | 426 prefs_->AddPrefInitObserver(base::Bind(&ProfileImpl::OnPrefsLoaded, |
| (...skipping 723 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1150 base::FilePath* cache_path, | 1150 base::FilePath* cache_path, |
| 1151 int* max_size) { | 1151 int* max_size) { |
| 1152 DCHECK(cache_path); | 1152 DCHECK(cache_path); |
| 1153 DCHECK(max_size); | 1153 DCHECK(max_size); |
| 1154 base::FilePath path(prefs_->GetFilePath(prefs::kDiskCacheDir)); | 1154 base::FilePath path(prefs_->GetFilePath(prefs::kDiskCacheDir)); |
| 1155 if (!path.empty()) | 1155 if (!path.empty()) |
| 1156 *cache_path = path; | 1156 *cache_path = path; |
| 1157 *max_size = is_media_context ? prefs_->GetInteger(prefs::kMediaCacheSize) : | 1157 *max_size = is_media_context ? prefs_->GetInteger(prefs::kMediaCacheSize) : |
| 1158 prefs_->GetInteger(prefs::kDiskCacheSize); | 1158 prefs_->GetInteger(prefs::kDiskCacheSize); |
| 1159 } | 1159 } |
| OLD | NEW |