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

Side by Side Diff: trunk/src/base/prefs/persistent_pref_store.h

Issue 273243002: Revert 269415 "Introduce a new framework for back-and-forth trac..." (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: Created 6 years, 7 months 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 | « trunk/src/base/prefs/json_pref_store_unittest.cc ('k') | trunk/src/base/prefs/pref_filter.h » ('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 (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 #ifndef BASE_PREFS_PERSISTENT_PREF_STORE_H_ 5 #ifndef BASE_PREFS_PERSISTENT_PREF_STORE_H_
6 #define BASE_PREFS_PERSISTENT_PREF_STORE_H_ 6 #define BASE_PREFS_PERSISTENT_PREF_STORE_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/prefs/base_prefs_export.h" 10 #include "base/prefs/base_prefs_export.h"
11 #include "base/prefs/writeable_pref_store.h" 11 #include "base/prefs/writeable_pref_store.h"
12 12
13 // This interface is complementary to the PrefStore interface, declaring 13 // This interface is complementary to the PrefStore interface, declaring
14 // additional functionality that adds support for setting values and persisting 14 // additional functionality that adds support for setting values and persisting
15 // the data to some backing store. 15 // the data to some backing store.
16 class BASE_PREFS_EXPORT PersistentPrefStore : public WriteablePrefStore { 16 class BASE_PREFS_EXPORT PersistentPrefStore : public WriteablePrefStore {
17 public: 17 public:
18 // Unique integer code for each type of error so we can report them 18 // Unique integer code for each type of error so we can report them
19 // distinctly in a histogram. 19 // distinctly in a histogram.
20 // NOTE: Don't change the explicit values of the enums as it will change the 20 // NOTE: Don't change the order here as it will change the server's meaning
21 // server's meaning of the histogram. 21 // of the histogram.
22 enum PrefReadError { 22 enum PrefReadError {
23 PREF_READ_ERROR_NONE = 0, 23 PREF_READ_ERROR_NONE = 0,
24 PREF_READ_ERROR_JSON_PARSE = 1, 24 PREF_READ_ERROR_JSON_PARSE,
25 PREF_READ_ERROR_JSON_TYPE = 2, 25 PREF_READ_ERROR_JSON_TYPE,
26 PREF_READ_ERROR_ACCESS_DENIED = 3, 26 PREF_READ_ERROR_ACCESS_DENIED,
27 PREF_READ_ERROR_FILE_OTHER = 4, 27 PREF_READ_ERROR_FILE_OTHER,
28 PREF_READ_ERROR_FILE_LOCKED = 5, 28 PREF_READ_ERROR_FILE_LOCKED,
29 PREF_READ_ERROR_NO_FILE = 6, 29 PREF_READ_ERROR_NO_FILE,
30 PREF_READ_ERROR_JSON_REPEAT = 7, 30 PREF_READ_ERROR_JSON_REPEAT,
31 // PREF_READ_ERROR_OTHER = 8, // Deprecated. 31 PREF_READ_ERROR_OTHER,
32 PREF_READ_ERROR_FILE_NOT_SPECIFIED = 9, 32 PREF_READ_ERROR_FILE_NOT_SPECIFIED,
33 // Indicates that ReadPrefs() couldn't complete synchronously and is waiting
34 // for an asynchronous task to complete first.
35 PREF_READ_ERROR_ASYNCHRONOUS_TASK_INCOMPLETE = 10,
36 PREF_READ_ERROR_MAX_ENUM 33 PREF_READ_ERROR_MAX_ENUM
37 }; 34 };
38 35
39 class ReadErrorDelegate { 36 class ReadErrorDelegate {
40 public: 37 public:
41 virtual ~ReadErrorDelegate() {} 38 virtual ~ReadErrorDelegate() {}
42 39
43 virtual void OnError(PrefReadError error) = 0; 40 virtual void OnError(PrefReadError error) = 0;
44 }; 41 };
45 42
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
78 virtual void ReadPrefsAsync(ReadErrorDelegate* error_delegate) = 0; 75 virtual void ReadPrefsAsync(ReadErrorDelegate* error_delegate) = 0;
79 76
80 // Lands any pending writes to disk. 77 // Lands any pending writes to disk.
81 virtual void CommitPendingWrite() = 0; 78 virtual void CommitPendingWrite() = 0;
82 79
83 protected: 80 protected:
84 virtual ~PersistentPrefStore() {} 81 virtual ~PersistentPrefStore() {}
85 }; 82 };
86 83
87 #endif // BASE_PREFS_PERSISTENT_PREF_STORE_H_ 84 #endif // BASE_PREFS_PERSISTENT_PREF_STORE_H_
OLDNEW
« no previous file with comments | « trunk/src/base/prefs/json_pref_store_unittest.cc ('k') | trunk/src/base/prefs/pref_filter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698