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

Side by Side Diff: base/prefs/pref_service_factory.cc

Issue 90563003: Fix a race condition in preference metric reporting. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Also filter 'empty loads' as in new run or corrupted pref file scenarios. 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
« no previous file with comments | « base/prefs/pref_filter.h ('k') | chrome/browser/managed_mode/managed_user_settings_service.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "base/prefs/pref_service_factory.h" 5 #include "base/prefs/pref_service_factory.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/prefs/default_pref_store.h" 8 #include "base/prefs/default_pref_store.h"
9 #include "base/prefs/json_pref_store.h" 9 #include "base/prefs/json_pref_store.h"
10 #include "base/prefs/pref_filter.h"
10 #include "base/prefs/pref_notifier_impl.h" 11 #include "base/prefs/pref_notifier_impl.h"
11 #include "base/prefs/pref_service.h" 12 #include "base/prefs/pref_service.h"
12 13
13 #include "base/prefs/pref_value_store.h" 14 #include "base/prefs/pref_value_store.h"
14 15
15 namespace base { 16 namespace base {
16 17
17 namespace { 18 namespace {
18 19
19 // Do-nothing default implementation. 20 // Do-nothing default implementation.
(...skipping 10 matching lines...) Expand all
30 user_prefs_(NULL), 31 user_prefs_(NULL),
31 recommended_prefs_(NULL), 32 recommended_prefs_(NULL),
32 read_error_callback_(base::Bind(&DoNothingHandleReadError)), 33 read_error_callback_(base::Bind(&DoNothingHandleReadError)),
33 async_(false) {} 34 async_(false) {}
34 35
35 PrefServiceFactory::~PrefServiceFactory() {} 36 PrefServiceFactory::~PrefServiceFactory() {}
36 37
37 void PrefServiceFactory::SetUserPrefsFile( 38 void PrefServiceFactory::SetUserPrefsFile(
38 const base::FilePath& prefs_file, 39 const base::FilePath& prefs_file,
39 base::SequencedTaskRunner* task_runner) { 40 base::SequencedTaskRunner* task_runner) {
40 user_prefs_ = new JsonPrefStore(prefs_file, task_runner); 41 user_prefs_ = new JsonPrefStore(
42 prefs_file, task_runner, scoped_ptr<PrefFilter>());
41 } 43 }
42 44
43 scoped_ptr<PrefService> PrefServiceFactory::Create( 45 scoped_ptr<PrefService> PrefServiceFactory::Create(
44 PrefRegistry* pref_registry) { 46 PrefRegistry* pref_registry) {
45 PrefNotifierImpl* pref_notifier = new PrefNotifierImpl(); 47 PrefNotifierImpl* pref_notifier = new PrefNotifierImpl();
46 scoped_ptr<PrefService> pref_service( 48 scoped_ptr<PrefService> pref_service(
47 new PrefService(pref_notifier, 49 new PrefService(pref_notifier,
48 new PrefValueStore(managed_prefs_.get(), 50 new PrefValueStore(managed_prefs_.get(),
49 supervised_user_prefs_.get(), 51 supervised_user_prefs_.get(),
50 extension_prefs_.get(), 52 extension_prefs_.get(),
51 command_line_prefs_.get(), 53 command_line_prefs_.get(),
52 user_prefs_.get(), 54 user_prefs_.get(),
53 recommended_prefs_.get(), 55 recommended_prefs_.get(),
54 pref_registry->defaults().get(), 56 pref_registry->defaults().get(),
55 pref_notifier), 57 pref_notifier),
56 user_prefs_.get(), 58 user_prefs_.get(),
57 pref_registry, 59 pref_registry,
58 read_error_callback_, 60 read_error_callback_,
59 async_)); 61 async_));
60 return pref_service.Pass(); 62 return pref_service.Pass();
61 } 63 }
62 64
63 } // namespace base 65 } // namespace base
OLDNEW
« no previous file with comments | « base/prefs/pref_filter.h ('k') | chrome/browser/managed_mode/managed_user_settings_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698