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 370 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
381 policy_service_ = | 381 policy_service_ = |
382 g_browser_process->browser_policy_connector()->CreatePolicyService(this); | 382 g_browser_process->browser_policy_connector()->CreatePolicyService(this); |
383 #else | 383 #else |
384 policy_service_.reset(new policy::PolicyServiceStub()); | 384 policy_service_.reset(new policy::PolicyServiceStub()); |
385 #endif | 385 #endif |
386 | 386 |
387 DCHECK(create_mode == CREATE_MODE_ASYNCHRONOUS || | 387 DCHECK(create_mode == CREATE_MODE_ASYNCHRONOUS || |
388 create_mode == CREATE_MODE_SYNCHRONOUS); | 388 create_mode == CREATE_MODE_SYNCHRONOUS); |
389 bool async_prefs = create_mode == CREATE_MODE_ASYNCHRONOUS; | 389 bool async_prefs = create_mode == CREATE_MODE_ASYNCHRONOUS; |
390 | 390 |
391 Profile::RegisterUserPrefs(pref_registry_); | |
392 | |
393 { | 391 { |
394 // On startup, preference loading is always synchronous so a scoped timer | 392 // On startup, preference loading is always synchronous so a scoped timer |
395 // will work here. | 393 // will work here. |
396 startup_metric_utils::ScopedSlowStartupUMA | 394 startup_metric_utils::ScopedSlowStartupUMA |
397 scoped_timer("Startup.SlowStartupPreferenceLoading"); | 395 scoped_timer("Startup.SlowStartupPreferenceLoading"); |
398 prefs_.reset(chrome_prefs::CreateProfilePrefs( | 396 prefs_.reset(chrome_prefs::CreateProfilePrefs( |
399 GetPrefFilePath(), | 397 GetPrefFilePath(), |
400 sequenced_task_runner, | 398 sequenced_task_runner, |
401 policy_service_.get(), | 399 policy_service_.get(), |
402 new ExtensionPrefStore( | 400 new ExtensionPrefStore( |
(...skipping 781 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1184 base::FilePath* cache_path, | 1182 base::FilePath* cache_path, |
1185 int* max_size) { | 1183 int* max_size) { |
1186 DCHECK(cache_path); | 1184 DCHECK(cache_path); |
1187 DCHECK(max_size); | 1185 DCHECK(max_size); |
1188 base::FilePath path(prefs_->GetFilePath(prefs::kDiskCacheDir)); | 1186 base::FilePath path(prefs_->GetFilePath(prefs::kDiskCacheDir)); |
1189 if (!path.empty()) | 1187 if (!path.empty()) |
1190 *cache_path = path; | 1188 *cache_path = path; |
1191 *max_size = is_media_context ? prefs_->GetInteger(prefs::kMediaCacheSize) : | 1189 *max_size = is_media_context ? prefs_->GetInteger(prefs::kMediaCacheSize) : |
1192 prefs_->GetInteger(prefs::kDiskCacheSize); | 1190 prefs_->GetInteger(prefs::kDiskCacheSize); |
1193 } | 1191 } |
OLD | NEW |