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

Side by Side Diff: content/common/leveldb_wrapper.mojom

Issue 2596603002: Make LevelDBObserver an associated interface to LevelDBWrapper. (Closed)
Patch Set: Created 4 years 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 unified diff | Download patch
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 module content.mojom; 5 module content.mojom;
6 6
7 import "components/leveldb/public/interfaces/leveldb.mojom"; 7 import "components/leveldb/public/interfaces/leveldb.mojom";
8 8
9 // Gives information about changes to a LevelDB database. 9 // Gives information about changes to a LevelDB database.
10 // Note that observer methods are called before the callbacks for the 10 // Note that observer methods are called before the callbacks for the
(...skipping 12 matching lines...) Expand all
23 }; 23 };
24 24
25 struct KeyValue { 25 struct KeyValue {
26 array<uint8> key; 26 array<uint8> key;
27 array<uint8> value; 27 array<uint8> value;
28 }; 28 };
29 29
30 // A wrapper around leveldb that supports giving notifications when values 30 // A wrapper around leveldb that supports giving notifications when values
31 // change. 31 // change.
32 interface LevelDBWrapper { 32 interface LevelDBWrapper {
33 AddObserver(associated LevelDBObserver observer);
34
33 // Sets the database entry for |key| to |value|. Returns OK on success. 35 // Sets the database entry for |key| to |value|. Returns OK on success.
34 Put(array<uint8> key, array<uint8> value, string source) => (bool success); 36 Put(array<uint8> key, array<uint8> value, string source) => (bool success);
35 37
36 // Remove the database entry (if any) for |key|. Returns OK on success, and a 38 // Remove the database entry (if any) for |key|. Returns OK on success, and a
37 // non-OK status on error. It is not an error if |key| did not exist in the 39 // non-OK status on error. It is not an error if |key| did not exist in the
38 // database. 40 // database.
39 Delete(array<uint8> key, string source) => (bool success); 41 Delete(array<uint8> key, string source) => (bool success);
40 42
41 // Removes all the entries. 43 // Removes all the entries.
42 DeleteAll(string source) => (bool success); 44 DeleteAll(string source) => (bool success);
43 45
44 // Returns the value of the |key|. 46 // Returns the value of the |key|.
45 Get(array<uint8> key) => (bool success, array<uint8> value); 47 Get(array<uint8> key) => (bool success, array<uint8> value);
46 48
47 // Only used with small databases. Returns all key/value pairs. 49 // Only used with small databases. Returns all key/value pairs.
48 [Sync] 50 [Sync]
49 GetAll(string source) 51 GetAll(string source)
50 => (leveldb.mojom.DatabaseError status, array<KeyValue> data); 52 => (leveldb.mojom.DatabaseError status, array<KeyValue> data);
51 }; 53 };
OLDNEW
« no previous file with comments | « content/browser/storage_partition_impl.cc ('k') | content/common/storage_partition_service.mojom » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698