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/prefs/chrome_pref_service_factory.h" | 5 #include "chrome/browser/prefs/chrome_pref_service_factory.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
11 #include "base/compiler_specific.h" | 11 #include "base/compiler_specific.h" |
12 #include "base/files/file_path.h" | 12 #include "base/files/file_path.h" |
13 #include "base/metrics/field_trial.h" | 13 #include "base/metrics/field_trial.h" |
14 #include "base/metrics/histogram.h" | 14 #include "base/metrics/histogram_macros.h" |
15 #include "base/prefs/default_pref_store.h" | 15 #include "base/prefs/default_pref_store.h" |
16 #include "base/prefs/json_pref_store.h" | 16 #include "base/prefs/json_pref_store.h" |
17 #include "base/prefs/pref_filter.h" | 17 #include "base/prefs/pref_filter.h" |
18 #include "base/prefs/pref_notifier_impl.h" | 18 #include "base/prefs/pref_notifier_impl.h" |
19 #include "base/prefs/pref_registry.h" | 19 #include "base/prefs/pref_registry.h" |
20 #include "base/prefs/pref_registry_simple.h" | 20 #include "base/prefs/pref_registry_simple.h" |
21 #include "base/prefs/pref_service.h" | 21 #include "base/prefs/pref_service.h" |
22 #include "base/prefs/pref_store.h" | 22 #include "base/prefs/pref_store.h" |
23 #include "base/prefs/pref_value_store.h" | 23 #include "base/prefs/pref_value_store.h" |
24 #include "base/threading/sequenced_worker_pool.h" | 24 #include "base/threading/sequenced_worker_pool.h" |
(...skipping 469 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
494 scoped_ptr<PrefServiceSyncable> CreateProfilePrefs( | 494 scoped_ptr<PrefServiceSyncable> CreateProfilePrefs( |
495 const base::FilePath& profile_path, | 495 const base::FilePath& profile_path, |
496 base::SequencedTaskRunner* pref_io_task_runner, | 496 base::SequencedTaskRunner* pref_io_task_runner, |
497 TrackedPreferenceValidationDelegate* validation_delegate, | 497 TrackedPreferenceValidationDelegate* validation_delegate, |
498 policy::PolicyService* policy_service, | 498 policy::PolicyService* policy_service, |
499 SupervisedUserSettingsService* supervised_user_settings, | 499 SupervisedUserSettingsService* supervised_user_settings, |
500 const scoped_refptr<PrefStore>& extension_prefs, | 500 const scoped_refptr<PrefStore>& extension_prefs, |
501 const scoped_refptr<user_prefs::PrefRegistrySyncable>& pref_registry, | 501 const scoped_refptr<user_prefs::PrefRegistrySyncable>& pref_registry, |
502 bool async) { | 502 bool async) { |
503 TRACE_EVENT0("browser", "chrome_prefs::CreateProfilePrefs"); | 503 TRACE_EVENT0("browser", "chrome_prefs::CreateProfilePrefs"); |
| 504 SCOPED_UMA_HISTOGRAM_TIMER("PrefService.CreateProfilePrefsTime"); |
504 | 505 |
505 // A StartSyncFlare used to kick sync early in case of a reset event. This is | 506 // A StartSyncFlare used to kick sync early in case of a reset event. This is |
506 // done since sync may bring back the user's server value post-reset which | 507 // done since sync may bring back the user's server value post-reset which |
507 // could potentially cause a "settings flash" between the factory default and | 508 // could potentially cause a "settings flash" between the factory default and |
508 // the re-instantiated server value. Starting sync ASAP minimizes the window | 509 // the re-instantiated server value. Starting sync ASAP minimizes the window |
509 // before the server value is re-instantiated (this window can otherwise be | 510 // before the server value is re-instantiated (this window can otherwise be |
510 // as long as 10 seconds by default). | 511 // as long as 10 seconds by default). |
511 const base::Closure start_sync_flare_for_prefs = | 512 const base::Closure start_sync_flare_for_prefs = |
512 base::Bind(sync_start_util::GetFlareForSyncableService(profile_path), | 513 base::Bind(sync_start_util::GetFlareForSyncableService(profile_path), |
513 syncer::PREFERENCES); | 514 syncer::PREFERENCES); |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
568 | 569 |
569 void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry) { | 570 void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry) { |
570 ProfilePrefStoreManager::RegisterProfilePrefs(registry); | 571 ProfilePrefStoreManager::RegisterProfilePrefs(registry); |
571 } | 572 } |
572 | 573 |
573 void RegisterPrefs(PrefRegistrySimple* registry) { | 574 void RegisterPrefs(PrefRegistrySimple* registry) { |
574 ProfilePrefStoreManager::RegisterPrefs(registry); | 575 ProfilePrefStoreManager::RegisterPrefs(registry); |
575 } | 576 } |
576 | 577 |
577 } // namespace chrome_prefs | 578 } // namespace chrome_prefs |
OLD | NEW |