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

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

Issue 90563003: Fix a race condition in preference metric reporting. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years 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 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
53 #include "chrome/browser/net/predictor.h" 53 #include "chrome/browser/net/predictor.h"
54 #include "chrome/browser/net/pref_proxy_config_tracker.h" 54 #include "chrome/browser/net/pref_proxy_config_tracker.h"
55 #include "chrome/browser/net/proxy_service_factory.h" 55 #include "chrome/browser/net/proxy_service_factory.h"
56 #include "chrome/browser/net/ssl_config_service_manager.h" 56 #include "chrome/browser/net/ssl_config_service_manager.h"
57 #include "chrome/browser/plugins/chrome_plugin_service_filter.h" 57 #include "chrome/browser/plugins/chrome_plugin_service_filter.h"
58 #include "chrome/browser/plugins/plugin_prefs.h" 58 #include "chrome/browser/plugins/plugin_prefs.h"
59 #include "chrome/browser/policy/profile_policy_connector.h" 59 #include "chrome/browser/policy/profile_policy_connector.h"
60 #include "chrome/browser/policy/profile_policy_connector_factory.h" 60 #include "chrome/browser/policy/profile_policy_connector_factory.h"
61 #include "chrome/browser/prefs/browser_prefs.h" 61 #include "chrome/browser/prefs/browser_prefs.h"
62 #include "chrome/browser/prefs/chrome_pref_service_factory.h" 62 #include "chrome/browser/prefs/chrome_pref_service_factory.h"
63 #include "chrome/browser/prefs/pref_hash_store_impl.h"
63 #include "chrome/browser/prefs/pref_service_syncable.h" 64 #include "chrome/browser/prefs/pref_service_syncable.h"
64 #include "chrome/browser/prerender/prerender_manager_factory.h" 65 #include "chrome/browser/prerender/prerender_manager_factory.h"
65 #include "chrome/browser/profiles/bookmark_model_loaded_observer.h" 66 #include "chrome/browser/profiles/bookmark_model_loaded_observer.h"
66 #include "chrome/browser/profiles/chrome_version_service.h" 67 #include "chrome/browser/profiles/chrome_version_service.h"
67 #include "chrome/browser/profiles/gaia_info_update_service_factory.h" 68 #include "chrome/browser/profiles/gaia_info_update_service_factory.h"
68 #include "chrome/browser/profiles/profile_destroyer.h" 69 #include "chrome/browser/profiles/profile_destroyer.h"
69 #include "chrome/browser/profiles/profile_info_cache.h" 70 #include "chrome/browser/profiles/profile_info_cache.h"
70 #include "chrome/browser/profiles/profile_manager.h" 71 #include "chrome/browser/profiles/profile_manager.h"
71 #include "chrome/browser/search_engines/template_url_fetcher.h" 72 #include "chrome/browser/search_engines/template_url_fetcher.h"
72 #include "chrome/browser/sessions/session_service_factory.h" 73 #include "chrome/browser/sessions/session_service_factory.h"
(...skipping 12 matching lines...) Expand all
85 #include "components/user_prefs/pref_registry_syncable.h" 86 #include "components/user_prefs/pref_registry_syncable.h"
86 #include "components/user_prefs/user_prefs.h" 87 #include "components/user_prefs/user_prefs.h"
87 #include "content/public/browser/browser_thread.h" 88 #include "content/public/browser/browser_thread.h"
88 #include "content/public/browser/dom_storage_context.h" 89 #include "content/public/browser/dom_storage_context.h"
89 #include "content/public/browser/host_zoom_map.h" 90 #include "content/public/browser/host_zoom_map.h"
90 #include "content/public/browser/notification_service.h" 91 #include "content/public/browser/notification_service.h"
91 #include "content/public/browser/render_process_host.h" 92 #include "content/public/browser/render_process_host.h"
92 #include "content/public/browser/storage_partition.h" 93 #include "content/public/browser/storage_partition.h"
93 #include "content/public/browser/user_metrics.h" 94 #include "content/public/browser/user_metrics.h"
94 #include "content/public/common/content_constants.h" 95 #include "content/public/common/content_constants.h"
96 #include "grit/browser_resources.h"
95 #include "grit/chromium_strings.h" 97 #include "grit/chromium_strings.h"
96 #include "grit/generated_resources.h" 98 #include "grit/generated_resources.h"
97 #include "ui/base/l10n/l10n_util.h" 99 #include "ui/base/l10n/l10n_util.h"
98 100
99 #if defined(ENABLE_CONFIGURATION_POLICY) 101 #if defined(ENABLE_CONFIGURATION_POLICY)
100 #include "chrome/browser/policy/browser_policy_connector.h" 102 #include "chrome/browser/policy/browser_policy_connector.h"
101 #include "chrome/browser/policy/schema_registry_service.h" 103 #include "chrome/browser/policy/schema_registry_service.h"
102 #include "chrome/browser/policy/schema_registry_service_factory.h" 104 #include "chrome/browser/policy/schema_registry_service_factory.h"
103 #if defined(OS_CHROMEOS) 105 #if defined(OS_CHROMEOS)
104 #include "chrome/browser/chromeos/policy/user_cloud_policy_manager_chromeos.h" 106 #include "chrome/browser/chromeos/policy/user_cloud_policy_manager_chromeos.h"
(...skipping 340 matching lines...) Expand 10 before | Expand all | Expand 10 after
445 { 447 {
446 // On startup, preference loading is always synchronous so a scoped timer 448 // On startup, preference loading is always synchronous so a scoped timer
447 // will work here. 449 // will work here.
448 startup_metric_utils::ScopedSlowStartupUMA 450 startup_metric_utils::ScopedSlowStartupUMA
449 scoped_timer("Startup.SlowStartupPreferenceLoading"); 451 scoped_timer("Startup.SlowStartupPreferenceLoading");
450 prefs_.reset(chrome_prefs::CreateProfilePrefs( 452 prefs_.reset(chrome_prefs::CreateProfilePrefs(
451 GetPrefFilePath(), 453 GetPrefFilePath(),
452 sequenced_task_runner, 454 sequenced_task_runner,
453 profile_policy_connector_->policy_service(), 455 profile_policy_connector_->policy_service(),
454 managed_user_settings, 456 managed_user_settings,
457 scoped_ptr<PrefHashStore>(new PrefHashStoreImpl(
robertshield 2013/11/28 02:54:26 Is there a benefit to wrapping this in a scoped po
gab 2013/11/28 04:12:03 FWIW, I like the paradigm of passing via scoped_pt
erikwright (departed) 2013/11/28 17:48:07 AFAIU, this is the new gold standard for documenti
458 ResourceBundle::GetSharedInstance().GetRawDataResource(
459 IDR_PREF_HASH_SEED_BIN).as_string(),
460 g_browser_process->local_state(),
461 this->GetPath().AsUTF8Unsafe())),
455 new ExtensionPrefStore( 462 new ExtensionPrefStore(
456 ExtensionPrefValueMapFactory::GetForBrowserContext(this), false), 463 ExtensionPrefValueMapFactory::GetForBrowserContext(this), false),
457 pref_registry_, 464 pref_registry_,
458 async_prefs)); 465 async_prefs));
459 // Register on BrowserContext. 466 // Register on BrowserContext.
460 user_prefs::UserPrefs::Set(this, prefs_.get()); 467 user_prefs::UserPrefs::Set(this, prefs_.get());
461 } 468 }
462 469
463 startup_metric_utils::ScopedSlowStartupUMA 470 startup_metric_utils::ScopedSlowStartupUMA
464 scoped_timer("Startup.SlowStartupFinalProfileInit"); 471 scoped_timer("Startup.SlowStartupFinalProfileInit");
(...skipping 776 matching lines...) Expand 10 before | Expand all | Expand 10 after
1241 PrefProxyConfigTracker* ProfileImpl::CreateProxyConfigTracker() { 1248 PrefProxyConfigTracker* ProfileImpl::CreateProxyConfigTracker() {
1242 #if defined(OS_CHROMEOS) 1249 #if defined(OS_CHROMEOS)
1243 if (chromeos::ProfileHelper::IsSigninProfile(this)) { 1250 if (chromeos::ProfileHelper::IsSigninProfile(this)) {
1244 return ProxyServiceFactory::CreatePrefProxyConfigTrackerOfLocalState( 1251 return ProxyServiceFactory::CreatePrefProxyConfigTrackerOfLocalState(
1245 g_browser_process->local_state()); 1252 g_browser_process->local_state());
1246 } 1253 }
1247 #endif // defined(OS_CHROMEOS) 1254 #endif // defined(OS_CHROMEOS)
1248 return ProxyServiceFactory::CreatePrefProxyConfigTrackerOfProfile( 1255 return ProxyServiceFactory::CreatePrefProxyConfigTrackerOfProfile(
1249 GetPrefs(), g_browser_process->local_state()); 1256 GetPrefs(), g_browser_process->local_state());
1250 } 1257 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698