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

Unified Diff: content/browser/level_db_wrapper_impl.h

Issue 1745603002: Switch LevelDBWrapper::GetAll to use the new Mojo sync IPC mechanism. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: review comment Created 4 years, 10 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: content/browser/level_db_wrapper_impl.h
diff --git a/content/browser/level_db_wrapper_impl.h b/content/browser/level_db_wrapper_impl.h
deleted file mode 100644
index 06ed3485f612589a34c8651497967ab37daf4452..0000000000000000000000000000000000000000
--- a/content/browser/level_db_wrapper_impl.h
+++ /dev/null
@@ -1,59 +0,0 @@
-// Copyright 2016 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 CONTENT_BROWSER_LEVEL_DB_WRAPPER_IMPL_H_
-#define CONTENT_BROWSER_LEVEL_DB_WRAPPER_IMPL_H_
-
-#include "base/callback.h"
-#include "base/macros.h"
-#include "content/common/leveldb_wrapper.mojom.h"
-#include "mojo/public/cpp/bindings/binding_set.h"
-
-namespace content {
-
-// This is a wrapper around a leveldb::LevelDBDatabase. It adds a couple of
-// features:
-// 1) Adds the given prefix, if any, to all keys. This allows the sharing of one
-// database across many, possibly untrusted, consumers and ensuring that they
-// can't access each other's values.
-// 2) Informs an observer when the given prefix' values are modified by another
-// process.
-// 3) Throttles requests to avoid overwhelming the disk.
-class LevelDBWrapperImpl : public LevelDBWrapper {
- public:
- // |no_bindings_callback| will be called when this object has no more
- // bindings.
- LevelDBWrapperImpl(const std::string& prefix,
- const base::Closure& no_bindings_callback);
- ~LevelDBWrapperImpl() override;
-
- void Bind(mojo::InterfaceRequest<LevelDBWrapper> request,
- LevelDBObserverPtr observer);
-
- private:
- // LevelDBWrapperImpl:
- void Put(mojo::Array<uint8_t> key,
- mojo::Array<uint8_t> value,
- const mojo::String& source,
- const PutCallback& callback) override;
- void Delete(mojo::Array<uint8_t> key,
- const mojo::String& source,
- const DeleteCallback& callback) override;
- void DeleteAll(const mojo::String& source,
- const DeleteAllCallback& callback) override;
- void Get(mojo::Array<uint8_t> key, const GetCallback& callback) override;
- void GetAll(const GetAllCallback& callback) override;
-
- void OnConnectionError();
-
- std::string prefix_;
- mojo::BindingSet<LevelDBWrapper> bindings_;
- base::Closure no_bindings_callback_;
-
- DISALLOW_COPY_AND_ASSIGN(LevelDBWrapperImpl);
-};
-
-} // namespace content
-
-#endif // CONTENT_BROWSER_LEVEL_DB_WRAPPER_IMPL_H_
« no previous file with comments | « content/browser/dom_storage/dom_storage_context_wrapper.cc ('k') | content/browser/level_db_wrapper_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698