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

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

Issue 6713032: Provide lazy CommitPendingWrites in addition to eager SavePersistentPrefs. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: removed notification + rebase Created 9 years, 9 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) 2010 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_JSON_PREF_STORE_H_ 5 #ifndef CHROME_COMMON_JSON_PREF_STORE_H_
6 #define CHROME_COMMON_JSON_PREF_STORE_H_ 6 #define CHROME_COMMON_JSON_PREF_STORE_H_
7 #pragma once 7 #pragma once
8 8
9 #include <string> 9 #include <string>
10 10
11 #include "base/basictypes.h" 11 #include "base/basictypes.h"
(...skipping 27 matching lines...) Expand all
39 virtual void RemoveObserver(PrefStore::Observer* observer); 39 virtual void RemoveObserver(PrefStore::Observer* observer);
40 40
41 // PersistentPrefStore overrides: 41 // PersistentPrefStore overrides:
42 virtual void SetValue(const std::string& key, Value* value); 42 virtual void SetValue(const std::string& key, Value* value);
43 virtual void SetValueSilently(const std::string& key, Value* value); 43 virtual void SetValueSilently(const std::string& key, Value* value);
44 virtual void RemoveValue(const std::string& key); 44 virtual void RemoveValue(const std::string& key);
45 virtual bool ReadOnly() const; 45 virtual bool ReadOnly() const;
46 virtual PrefReadError ReadPrefs(); 46 virtual PrefReadError ReadPrefs();
47 virtual bool WritePrefs(); 47 virtual bool WritePrefs();
48 virtual void ScheduleWritePrefs(); 48 virtual void ScheduleWritePrefs();
49 virtual void CommitPendingWrite();
49 // TODO(battre) remove this function 50 // TODO(battre) remove this function
50 virtual void ReportValueChanged(const std::string& key); 51 virtual void ReportValueChanged(const std::string& key);
51 52
52 private: 53 private:
53 // ImportantFileWriter::DataSerializer overrides: 54 // ImportantFileWriter::DataSerializer overrides:
54 virtual bool SerializeData(std::string* output); 55 virtual bool SerializeData(std::string* output);
55 56
56 FilePath path_; 57 FilePath path_;
57 58
58 scoped_ptr<DictionaryValue> prefs_; 59 scoped_ptr<DictionaryValue> prefs_;
59 60
60 bool read_only_; 61 bool read_only_;
61 62
62 // Helper for safely writing pref data. 63 // Helper for safely writing pref data.
63 ImportantFileWriter writer_; 64 ImportantFileWriter writer_;
64 65
65 ObserverList<PrefStore::Observer, true> observers_; 66 ObserverList<PrefStore::Observer, true> observers_;
66 67
67 DISALLOW_COPY_AND_ASSIGN(JsonPrefStore); 68 DISALLOW_COPY_AND_ASSIGN(JsonPrefStore);
68 }; 69 };
69 70
70 #endif // CHROME_COMMON_JSON_PREF_STORE_H_ 71 #endif // CHROME_COMMON_JSON_PREF_STORE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698