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

Unified Diff: chrome/browser/value_store/caching_value_store.h

Issue 10545128: Unrevert r141537: Add extensions::StateStore and use that instead of (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix.crash Created 8 years, 6 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
Index: chrome/browser/value_store/caching_value_store.h
diff --git a/chrome/browser/value_store/caching_value_store.h b/chrome/browser/value_store/caching_value_store.h
deleted file mode 100644
index 8b3662b4c8fc2a7287fae887c5d36e922be6133d..0000000000000000000000000000000000000000
--- a/chrome/browser/value_store/caching_value_store.h
+++ /dev/null
@@ -1,74 +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_BROWSER_VALUE_STORE_CACHING_VALUE_STORE_H_
-#define CHROME_BROWSER_VALUE_STORE_CACHING_VALUE_STORE_H_
-#pragma once
-
-#include <string>
-
-#include "base/file_path.h"
-#include "base/memory/ref_counted.h"
-#include "base/memory/scoped_ptr.h"
-#include "base/memory/weak_ptr.h"
-#include "base/observer_list.h"
-#include "base/threading/non_thread_safe.h"
-#include "base/values.h"
-
-// Value store area with caching, backed by a LeveldbValueStore on the FILE
-// thread. The key/value store is flat with no path expansion, meaning "foo"
-// and "foo.bar" are completely separate keys.
-class CachingValueStore
- : public base::SupportsWeakPtr<CachingValueStore>,
- public base::NonThreadSafe {
- public:
- class Observer {
- public:
- virtual ~Observer() {}
-
- // Notification that the Store is ready to use.
- virtual void OnInitializationComplete() = 0;
- };
-
- explicit CachingValueStore(const FilePath& db_path);
- ~CachingValueStore();
-
- // Retrieves a value from the cache, returning true if value with the given
- // key exists. The returned value is a reference to the value in the cache,
- // i.e. no copies are made.
- bool Get(const std::string& key, const base::Value** result);
-
- // Sets a value with the given key. Ownership of |value| is transferred to
- // the store.
- void Set(const std::string& key, base::Value* value);
-
- // Removes the value with the given key.
- void Remove(const std::string& key);
-
- // Returns true if the store has finished initializing.
- bool IsInitialized();
-
- void AddObserver(Observer* observer);
- void RemoveObserver(Observer* observer);
-
- private:
- class Backend;
-
- // Called when our backend finishes reading the database.
- void OnBackendReady(scoped_ptr<base::DictionaryValue> values);
-
- // A cache of the value store. This is always up-to-date, with changes
- // persisted to disk as they are made.
- scoped_ptr<base::DictionaryValue> cache_;
-
- // A helper class to manage lifetime of the backing ValueStore, which lives
- // on the FILE thread.
- scoped_refptr<Backend> backend_;
-
- ObserverList<Observer, true> observers_;
-
- DISALLOW_COPY_AND_ASSIGN(CachingValueStore);
-};
-
-#endif // CHROME_BROWSER_VALUE_STORE_CACHING_VALUE_STORE_H_
« no previous file with comments | « chrome/browser/extensions/test_extension_system.cc ('k') | chrome/browser/value_store/caching_value_store.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698