Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 leveldb.mojom; | 5 module leveldb.mojom; |
| 6 | 6 |
| 7 import "components/filesystem/public/interfaces/directory.mojom"; | 7 import "components/filesystem/public/interfaces/directory.mojom"; |
| 8 import "mojo/common/unguessable_token.mojom"; | 8 import "mojo/common/unguessable_token.mojom"; |
| 9 | 9 |
| 10 enum DatabaseError { | 10 enum DatabaseError { |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 64 interface LevelDBService { | 64 interface LevelDBService { |
| 65 Open(filesystem.mojom.Directory directory, | 65 Open(filesystem.mojom.Directory directory, |
| 66 string dbname, | 66 string dbname, |
| 67 LevelDBDatabase& database) => (DatabaseError status); | 67 LevelDBDatabase& database) => (DatabaseError status); |
| 68 OpenWithOptions(OpenOptions options, | 68 OpenWithOptions(OpenOptions options, |
| 69 filesystem.mojom.Directory directory, | 69 filesystem.mojom.Directory directory, |
| 70 string dbname, | 70 string dbname, |
| 71 LevelDBDatabase& database) => (DatabaseError status); | 71 LevelDBDatabase& database) => (DatabaseError status); |
| 72 | 72 |
| 73 OpenInMemory(LevelDBDatabase& database) => (DatabaseError status); | 73 OpenInMemory(LevelDBDatabase& database) => (DatabaseError status); |
| 74 | |
| 75 Destroy(filesystem.mojom.Directory directory, | |
| 76 string dbname) => (DatabaseError status); | |
|
jam
2017/01/12 17:24:42
nit: indentation
also please add documentation to
Marijn Kruisselbrink
2017/01/13 19:25:11
Fixed, also added (minimal) documentation to the v
| |
| 74 }; | 77 }; |
| 75 | 78 |
| 76 // A leveldb database. | 79 // A leveldb database. |
| 77 interface LevelDBDatabase { | 80 interface LevelDBDatabase { |
| 78 // Basic Interface ------------------------------------------------------- | 81 // Basic Interface ------------------------------------------------------- |
| 79 | 82 |
| 80 // Sets the database entry for "key" to "value". Returns OK on success. | 83 // Sets the database entry for "key" to "value". Returns OK on success. |
| 81 Put(array<uint8> key, array<uint8> value) => (DatabaseError status); | 84 Put(array<uint8> key, array<uint8> value) => (DatabaseError status); |
| 82 | 85 |
| 83 // Remove the database entry (if any) for "key". Returns OK on | 86 // Remove the database entry (if any) for "key". Returns OK on |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 136 // Moves forward or backwards in iterator space. | 139 // Moves forward or backwards in iterator space. |
| 137 [Sync] | 140 [Sync] |
| 138 IteratorNext(mojo.common.mojom.UnguessableToken iterator) | 141 IteratorNext(mojo.common.mojom.UnguessableToken iterator) |
| 139 => (bool valid, DatabaseError status, array<uint8>? key, | 142 => (bool valid, DatabaseError status, array<uint8>? key, |
| 140 array<uint8>? value); | 143 array<uint8>? value); |
| 141 [Sync] | 144 [Sync] |
| 142 IteratorPrev(mojo.common.mojom.UnguessableToken iterator) | 145 IteratorPrev(mojo.common.mojom.UnguessableToken iterator) |
| 143 => (bool valid, DatabaseError status, array<uint8>? key, | 146 => (bool valid, DatabaseError status, array<uint8>? key, |
| 144 array<uint8>? value); | 147 array<uint8>? value); |
| 145 }; | 148 }; |
| OLD | NEW |