diff options
author | inferno@chromium.org <inferno@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-06-12 03:12:16 +0000 |
---|---|---|
committer | inferno@chromium.org <inferno@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-06-12 03:12:16 +0000 |
commit | 9b5212698d5c13693fbc57b4da25789ea62aa836 (patch) | |
tree | 67930a9a57c1c33f2ca059fd983ab89f5572ac1d /chrome/browser/value_store/value_store_frontend.h | |
parent | 1d3e917629c873ec30133f7023e35c5218a97725 (diff) | |
download | chromium_src-9b5212698d5c13693fbc57b4da25789ea62aa836.zip chromium_src-9b5212698d5c13693fbc57b4da25789ea62aa836.tar.gz chromium_src-9b5212698d5c13693fbc57b4da25789ea62aa836.tar.bz2 |
Revert 141514 - Remove CachingValueStore in favor of an async ValueStoreFrontend.
Caused massive number of use-after-free crashes on ClusterFuzz.
After actually seeing the use cases for the value store in extension code, I
realized that an async version would be more appropriate. This one will use
less memory as well, since we won't need to keep the cache in memory.
BUG=123366
TEST=no
Review URL: https://chromiumcodereview.appspot.com/10539073
TBR=mpcomplete@chromium.org
Review URL: https://chromiumcodereview.appspot.com/10537116
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@141603 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/value_store/value_store_frontend.h')
-rw-r--r-- | chrome/browser/value_store/value_store_frontend.h | 49 |
1 files changed, 0 insertions, 49 deletions
diff --git a/chrome/browser/value_store/value_store_frontend.h b/chrome/browser/value_store/value_store_frontend.h deleted file mode 100644 index f6027da..0000000 --- a/chrome/browser/value_store/value_store_frontend.h +++ /dev/null @@ -1,49 +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_VALUE_STORE_FRONTEND_H_ -#define CHROME_BROWSER_VALUE_STORE_VALUE_STORE_FRONTEND_H_ -#pragma once - -#include <string> - -#include "base/callback.h" -#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/threading/non_thread_safe.h" -#include "base/values.h" - -// A frontend for a LeveldbValueStore, for use on the UI thread. -class ValueStoreFrontend - : public base::SupportsWeakPtr<ValueStoreFrontend>, - public base::NonThreadSafe { - public: - typedef base::Callback<void(scoped_ptr<base::Value>)> ReadCallback; - - explicit ValueStoreFrontend(const FilePath& db_path); - ~ValueStoreFrontend(); - - // Retrieves a value from the database asynchronously, passing a copy to - // |callback| when ready. NULL is passed if no matching entry is found. - void Get(const std::string& key, const ReadCallback& callback); - - // Sets a value with the given key. - void Set(const std::string& key, scoped_ptr<base::Value> value); - - // Removes the value with the given key. - void Remove(const std::string& key); - - private: - class Backend; - - // A helper class to manage lifetime of the backing ValueStore, which lives - // on the FILE thread. - scoped_refptr<Backend> backend_; - - DISALLOW_COPY_AND_ASSIGN(ValueStoreFrontend); -}; - -#endif // CHROME_BROWSER_VALUE_STORE_VALUE_STORE_FRONTEND_H_ |