| 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; | 5 module leveldb; |
| 6 | 6 |
| 7 import "components/filesystem/public/interfaces/directory.mojom"; | 7 import "components/filesystem/public/interfaces/directory.mojom"; |
| 8 | 8 |
| 9 enum DatabaseError { | 9 enum DatabaseError { |
| 10 OK, | 10 OK, |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 54 // Number of open files that can be used by the DB. (Note: we globally set | 54 // Number of open files that can be used by the DB. (Note: we globally set |
| 55 // the default here to 80 instead of leveldb's default 1000 because we don't | 55 // the default here to 80 instead of leveldb's default 1000 because we don't |
| 56 // want to consume all file descriptors. See | 56 // want to consume all file descriptors. See |
| 57 // https://code.google.com/p/chromium/issues/detail?id=227313#c11 for | 57 // https://code.google.com/p/chromium/issues/detail?id=227313#c11 for |
| 58 // details.) | 58 // details.) |
| 59 int32 max_open_files = 80; | 59 int32 max_open_files = 80; |
| 60 }; | 60 }; |
| 61 | 61 |
| 62 // Service which hands out databases. | 62 // Service which hands out databases. |
| 63 interface LevelDBService { | 63 interface LevelDBService { |
| 64 Open(filesystem.Directory directory, | 64 Open(filesystem.mojom.Directory directory, |
| 65 string dbname, | 65 string dbname, |
| 66 LevelDBDatabase& database) => (DatabaseError status); | 66 LevelDBDatabase& database) => (DatabaseError status); |
| 67 OpenWithOptions(OpenOptions options, | 67 OpenWithOptions(OpenOptions options, |
| 68 filesystem.Directory directory, | 68 filesystem.mojom.Directory directory, |
| 69 string dbname, | 69 string dbname, |
| 70 LevelDBDatabase& database) => (DatabaseError status); | 70 LevelDBDatabase& database) => (DatabaseError status); |
| 71 | 71 |
| 72 OpenInMemory(LevelDBDatabase& database) => (DatabaseError status); | 72 OpenInMemory(LevelDBDatabase& database) => (DatabaseError status); |
| 73 }; | 73 }; |
| 74 | 74 |
| 75 // A leveldb database. | 75 // A leveldb database. |
| 76 interface LevelDBDatabase { | 76 interface LevelDBDatabase { |
| 77 // Basic Interface ------------------------------------------------------- | 77 // Basic Interface ------------------------------------------------------- |
| 78 | 78 |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 133 // Moves forward or backwards in iterator space. | 133 // Moves forward or backwards in iterator space. |
| 134 [Sync] | 134 [Sync] |
| 135 IteratorNext(uint64 iterator_id) | 135 IteratorNext(uint64 iterator_id) |
| 136 => (bool valid, DatabaseError status, array<uint8>? key, | 136 => (bool valid, DatabaseError status, array<uint8>? key, |
| 137 array<uint8>? value); | 137 array<uint8>? value); |
| 138 [Sync] | 138 [Sync] |
| 139 IteratorPrev(uint64 iterator_id) | 139 IteratorPrev(uint64 iterator_id) |
| 140 => (bool valid, DatabaseError status, array<uint8>? key, | 140 => (bool valid, DatabaseError status, array<uint8>? key, |
| 141 array<uint8>? value); | 141 array<uint8>? value); |
| 142 }; | 142 }; |
| OLD | NEW |