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

Side by Side Diff: chrome/common/persistent_pref_store.h

Issue 6894020: Adds async interface method to PersistentPrefStore. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Use Notifications. Created 9 years, 8 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
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 #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
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
55 virtual void SetValueSilently(const std::string& key, Value* value) = 0; 55 virtual void SetValueSilently(const std::string& key, Value* value) = 0;
56 56
57 // Removes the value for |key|. 57 // Removes the value for |key|.
58 virtual void RemoveValue(const std::string& key) = 0; 58 virtual void RemoveValue(const std::string& key) = 0;
59 59
60 // Whether the store is in a pseudo-read-only mode where changes are not 60 // Whether the store is in a pseudo-read-only mode where changes are not
61 // actually persisted to disk. This happens in some cases when there are 61 // actually persisted to disk. This happens in some cases when there are
62 // read errors during startup. 62 // read errors during startup.
63 virtual bool ReadOnly() const = 0; 63 virtual bool ReadOnly() const = 0;
64 64
65 // Reads the preferences from disk. 65 // Reads the preferences from disk. Notifies observers via
66 // "OnInitializationCompleted" when done.
Mattias Nissler (ping if slow) 2011/04/27 12:16:30 Maybe write PrefStore::Observer::OnInitializationC
altimofeev 2011/05/04 13:46:14 Done.
66 virtual PrefReadError ReadPrefs() = 0; 67 virtual PrefReadError ReadPrefs() = 0;
67 68
69 // Reads the preferences from disk asynchronously. Notifies observers via
70 // "OnInitializationCompleted" when done.
71 virtual void ReadPrefsAsync() = 0;
72
73 // Returns reading error and whether the error is fatal.
74 virtual void GetErrors(PrefReadError* error, bool* is_fatal) = 0;
75
68 // Writes the preferences to disk immediately. 76 // Writes the preferences to disk immediately.
69 virtual bool WritePrefs() = 0; 77 virtual bool WritePrefs() = 0;
70 78
71 // Schedules an asynchronous write operation. 79 // Schedules an asynchronous write operation.
72 virtual void ScheduleWritePrefs() = 0; 80 virtual void ScheduleWritePrefs() = 0;
73 81
74 // Lands any pending writes to disk. 82 // Lands any pending writes to disk.
75 virtual void CommitPendingWrite() = 0; 83 virtual void CommitPendingWrite() = 0;
76 }; 84 };
77 85
78 #endif // CHROME_COMMON_PERSISTENT_PREF_STORE_H_ 86 #endif // CHROME_COMMON_PERSISTENT_PREF_STORE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698