Chromium Code Reviews| Index: content/browser/leveldb_wrapper_impl.h |
| diff --git a/content/browser/leveldb_wrapper_impl.h b/content/browser/leveldb_wrapper_impl.h |
| index d224662ec893b71846774a57f70ad0a515da8272..4f9fb9f2a0ca0995eb13a29bc5e5f1d4bc3756d6 100644 |
| --- a/content/browser/leveldb_wrapper_impl.h |
| +++ b/content/browser/leveldb_wrapper_impl.h |
| @@ -12,6 +12,7 @@ |
| #include "base/callback.h" |
| #include "base/macros.h" |
| +#include "base/optional.h" |
| #include "base/time/time.h" |
| #include "content/common/leveldb_wrapper.mojom.h" |
| #include "mojo/public/cpp/bindings/binding_set.h" |
| @@ -52,7 +53,8 @@ class LevelDBWrapperImpl : public mojom::LevelDBWrapper { |
| static void EnableAggressiveCommitDelay(); |
| private: |
| - using ValueMap = std::map<mojo::Array<uint8_t>, mojo::Array<uint8_t>>; |
| + using ValueMap = |
| + std::map<std::vector<uint8_t>, base::Optional<std::vector<uint8_t>>>; |
|
michaeln
2016/08/02 00:28:29
why is the value type optional?
leonhsl(Using Gerrit)
2016/08/02 11:11:05
Yeah, it is to distinguish between puts and delete
|
| // Used to rate limit commits. |
| class RateLimiter { |
| @@ -87,17 +89,18 @@ class LevelDBWrapperImpl : public mojom::LevelDBWrapper { |
| }; |
| // LevelDBWrapperImpl: |
| - void Put(mojo::Array<uint8_t> key, |
| - mojo::Array<uint8_t> value, |
| - const mojo::String& source, |
| + void Put(const std::vector<uint8_t>& key, |
| + const std::vector<uint8_t>& value, |
| + const std::string& source, |
| const PutCallback& callback) override; |
| - void Delete(mojo::Array<uint8_t> key, |
| - const mojo::String& source, |
| + void Delete(const std::vector<uint8_t>& key, |
| + const std::string& source, |
| const DeleteCallback& callback) override; |
| - void DeleteAll(const mojo::String& source, |
| + void DeleteAll(const std::string& source, |
| const DeleteAllCallback& callback) override; |
| - void Get(mojo::Array<uint8_t> key, const GetCallback& callback) override; |
| - void GetAll(const mojo::String& source, |
| + void Get(const std::vector<uint8_t>& key, |
| + const GetCallback& callback) override; |
| + void GetAll(const std::string& source, |
| const GetAllCallback& callback) override; |
| void OnConnectionError(); |