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

Side by Side Diff: chrome/service/service_process_prefs.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 | « chrome/chrome_tests_unit.gypi ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/service/service_process_prefs.h" 5 #include "chrome/service/service_process_prefs.h"
6 6
7 #include "base/message_loop/message_loop_proxy.h" 7 #include "base/message_loop/message_loop_proxy.h"
8 #include "base/prefs/pref_filter.h"
8 #include "base/values.h" 9 #include "base/values.h"
9 10
10 ServiceProcessPrefs::ServiceProcessPrefs( 11 ServiceProcessPrefs::ServiceProcessPrefs(
11 const base::FilePath& pref_filename, 12 const base::FilePath& pref_filename,
12 base::SequencedTaskRunner* task_runner) 13 base::SequencedTaskRunner* task_runner)
13 : prefs_(new JsonPrefStore(pref_filename, task_runner)) { 14 : prefs_(new JsonPrefStore(pref_filename,
15 task_runner,
16 scoped_ptr<PrefFilter>())) {
14 } 17 }
15 18
16 ServiceProcessPrefs::~ServiceProcessPrefs() {} 19 ServiceProcessPrefs::~ServiceProcessPrefs() {}
17 20
18 void ServiceProcessPrefs::ReadPrefs() { 21 void ServiceProcessPrefs::ReadPrefs() {
19 prefs_->ReadPrefs(); 22 prefs_->ReadPrefs();
20 } 23 }
21 24
22 void ServiceProcessPrefs::WritePrefs() { 25 void ServiceProcessPrefs::WritePrefs() {
23 prefs_->CommitPendingWrite(); 26 prefs_->CommitPendingWrite();
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
88 } 91 }
89 92
90 void ServiceProcessPrefs::SetValue(const std::string& key, base::Value* value) { 93 void ServiceProcessPrefs::SetValue(const std::string& key, base::Value* value) {
91 prefs_->SetValue(key, value); 94 prefs_->SetValue(key, value);
92 } 95 }
93 96
94 void ServiceProcessPrefs::RemovePref(const std::string& key) { 97 void ServiceProcessPrefs::RemovePref(const std::string& key) {
95 prefs_->RemoveValue(key); 98 prefs_->RemoveValue(key);
96 } 99 }
97 100
OLDNEW
« no previous file with comments | « chrome/chrome_tests_unit.gypi ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698