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

Unified Diff: chrome/common/json_pref_store.h

Issue 11243002: Move the bits of Prefs where production code has only trivially easy (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address review comments, fix gypi problem Created 8 years, 2 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/chrome_tests.gypi ('k') | chrome/common/json_pref_store.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/common/json_pref_store.h
diff --git a/chrome/common/json_pref_store.h b/chrome/common/json_pref_store.h
deleted file mode 100644
index 7ceb7dad2ac0c472e51a1405e58861e6fd6ad93a..0000000000000000000000000000000000000000
--- a/chrome/common/json_pref_store.h
+++ /dev/null
@@ -1,93 +0,0 @@
-// Copyright (c) 2012 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 CHROME_COMMON_JSON_PREF_STORE_H_
-#define CHROME_COMMON_JSON_PREF_STORE_H_
-
-#include <set>
-#include <string>
-
-#include "base/basictypes.h"
-#include "base/compiler_specific.h"
-#include "base/file_path.h"
-#include "base/memory/scoped_ptr.h"
-#include "base/observer_list.h"
-#include "chrome/common/important_file_writer.h"
-#include "chrome/common/persistent_pref_store.h"
-
-namespace base {
-class DictionaryValue;
-class MessageLoopProxy;
-class Value;
-}
-
-class FilePath;
-
-// A writable PrefStore implementation that is used for user preferences.
-class JsonPrefStore : public PersistentPrefStore,
- public ImportantFileWriter::DataSerializer {
- public:
- // |file_message_loop_proxy| is the MessageLoopProxy for a thread on which
- // file I/O can be done.
- JsonPrefStore(const FilePath& pref_filename,
- base::MessageLoopProxy* file_message_loop_proxy);
-
- // PrefStore overrides:
- virtual ReadResult GetValue(const std::string& key,
- const base::Value** result) const OVERRIDE;
- virtual void AddObserver(PrefStore::Observer* observer) OVERRIDE;
- virtual void RemoveObserver(PrefStore::Observer* observer) OVERRIDE;
- virtual size_t NumberOfObservers() const OVERRIDE;
- virtual bool IsInitializationComplete() const OVERRIDE;
-
- // PersistentPrefStore overrides:
- virtual ReadResult GetMutableValue(const std::string& key,
- base::Value** result) OVERRIDE;
- virtual void SetValue(const std::string& key, base::Value* value) OVERRIDE;
- virtual void SetValueSilently(const std::string& key,
- base::Value* value) OVERRIDE;
- virtual void RemoveValue(const std::string& key) OVERRIDE;
- virtual void MarkNeedsEmptyValue(const std::string& key) OVERRIDE;
- virtual bool ReadOnly() const OVERRIDE;
- virtual PrefReadError GetReadError() const OVERRIDE;
- virtual PrefReadError ReadPrefs() OVERRIDE;
- virtual void ReadPrefsAsync(ReadErrorDelegate* error_delegate) OVERRIDE;
- virtual void CommitPendingWrite() OVERRIDE;
- virtual void ReportValueChanged(const std::string& key) OVERRIDE;
-
- // This method is called after JSON file has been read. Method takes
- // ownership of the |value| pointer. Note, this method is used with
- // asynchronous file reading, so class exposes it only for the internal needs.
- // (read: do not call it manually).
- void OnFileRead(base::Value* value_owned, PrefReadError error, bool no_dir);
-
- private:
- virtual ~JsonPrefStore();
-
- // ImportantFileWriter::DataSerializer overrides:
- virtual bool SerializeData(std::string* output) OVERRIDE;
-
- FilePath path_;
- scoped_refptr<base::MessageLoopProxy> file_message_loop_proxy_;
-
- scoped_ptr<base::DictionaryValue> prefs_;
-
- bool read_only_;
-
- // Helper for safely writing pref data.
- ImportantFileWriter writer_;
-
- ObserverList<PrefStore::Observer, true> observers_;
-
- scoped_ptr<ReadErrorDelegate> error_delegate_;
-
- bool initialized_;
- PrefReadError read_error_;
-
- std::set<std::string> keys_need_empty_value_;
-
- DISALLOW_COPY_AND_ASSIGN(JsonPrefStore);
-};
-
-#endif // CHROME_COMMON_JSON_PREF_STORE_H_
« no previous file with comments | « chrome/chrome_tests.gypi ('k') | chrome/common/json_pref_store.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698