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

Unified Diff: base/prefs/pref_filter.h

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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « base/prefs/json_pref_store_unittest.cc ('k') | base/prefs/pref_service_factory.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/prefs/pref_filter.h
diff --git a/base/prefs/pref_filter.h b/base/prefs/pref_filter.h
new file mode 100644
index 0000000000000000000000000000000000000000..3c7c8df38db6e5354ee5dc106a10fae804e23a8d
--- /dev/null
+++ b/base/prefs/pref_filter.h
@@ -0,0 +1,35 @@
+// Copyright (c) 2013 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef BASE_PREFS_PREF_FILTER_H_
+#define BASE_PREFS_PREF_FILTER_H_
+
+#include <string>
+
+#include "base/prefs/base_prefs_export.h"
+
+namespace base {
+class DictionaryValue;
+class Value;
+} // namespace base
+
+// Filters preferences as they are loaded from disk or updated at runtime.
+// Currently supported only by JsonPrefStore.
+class BASE_PREFS_EXPORT PrefFilter {
+ public:
+ virtual ~PrefFilter() {}
+
+ // Receives notification when the pref store data has been loaded but before
+ // Observers are notified.
+ // Changes made by a PrefFilter during FilterOnLoad do not result in
+ // notifications to |PrefStore::Observer|s.
+ virtual void FilterOnLoad(base::DictionaryValue* pref_store_contents) = 0;
+
+ // Receives notification when a pref store value is changed, before Observers
+ // are notified.
+ virtual void FilterUpdate(const std::string& path,
+ const base::Value* value) = 0;
+};
+
+#endif // BASE_PREFS_PREF_FILTER_H_
« no previous file with comments | « base/prefs/json_pref_store_unittest.cc ('k') | base/prefs/pref_service_factory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698