OLD | NEW |
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 #ifndef CHROME_COMMON_PERSISTENT_PREF_STORE_H_ | 5 #ifndef CHROME_COMMON_PERSISTENT_PREF_STORE_H_ |
6 #define CHROME_COMMON_PERSISTENT_PREF_STORE_H_ | 6 #define CHROME_COMMON_PERSISTENT_PREF_STORE_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 | 10 |
11 #include <chrome/common/pref_store.h> | 11 #include <chrome/common/pref_store.h> |
12 | 12 |
| 13 class NotificationSource; |
| 14 |
13 // This interface is complementary to the PrefStore interface, declaring | 15 // This interface is complementary to the PrefStore interface, declaring |
14 // additional functionality that adds support for setting values and persisting | 16 // additional functionality that adds support for setting values and persisting |
15 // the data to some backing store. | 17 // the data to some backing store. |
16 class PersistentPrefStore : public PrefStore { | 18 class PersistentPrefStore : public PrefStore { |
17 public: | 19 public: |
18 virtual ~PersistentPrefStore() {} | 20 virtual ~PersistentPrefStore() {} |
19 | 21 |
20 // Unique integer code for each type of error so we can report them | 22 // Unique integer code for each type of error so we can report them |
21 // distinctly in a histogram. | 23 // distinctly in a histogram. |
22 // NOTE: Don't change the order here as it will change the server's meaning | 24 // NOTE: Don't change the order here as it will change the server's meaning |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
60 virtual bool ReadOnly() const = 0; | 62 virtual bool ReadOnly() const = 0; |
61 | 63 |
62 // Reads the preferences from disk. | 64 // Reads the preferences from disk. |
63 virtual PrefReadError ReadPrefs() = 0; | 65 virtual PrefReadError ReadPrefs() = 0; |
64 | 66 |
65 // Writes the preferences to disk immediately. | 67 // Writes the preferences to disk immediately. |
66 virtual bool WritePrefs() = 0; | 68 virtual bool WritePrefs() = 0; |
67 | 69 |
68 // Schedules an asynchronous write operation. | 70 // Schedules an asynchronous write operation. |
69 virtual void ScheduleWritePrefs() = 0; | 71 virtual void ScheduleWritePrefs() = 0; |
| 72 |
| 73 // Lands any pending writes to disk. |
| 74 virtual void CommitPendingWrite() = 0; |
| 75 |
| 76 // Sets source to use for PREF_COMMITTED notification. |
| 77 virtual void SetNotificationSource(const NotificationSource& source) = 0; |
70 }; | 78 }; |
71 | 79 |
72 #endif // CHROME_COMMON_PERSISTENT_PREF_STORE_H_ | 80 #endif // CHROME_COMMON_PERSISTENT_PREF_STORE_H_ |
OLD | NEW |