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 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
55 // Number of open files that can be used by the DB. (Note: we globally set | 55 // Number of open files that can be used by the DB. (Note: we globally set |
56 // the default here to 80 instead of leveldb's default 1000 because we don't | 56 // the default here to 80 instead of leveldb's default 1000 because we don't |
57 // want to consume all file descriptors. See | 57 // want to consume all file descriptors. See |
58 // https://code.google.com/p/chromium/issues/detail?id=227313#c11 for | 58 // https://code.google.com/p/chromium/issues/detail?id=227313#c11 for |
59 // details.) | 59 // details.) |
60 int32 max_open_files = 80; | 60 int32 max_open_files = 80; |
61 }; | 61 }; |
62 | 62 |
63 // Service which hands out databases. | 63 // Service which hands out databases. |
64 interface LevelDBService { | 64 interface LevelDBService { |
65 // Sets the name of the environment to a custom value. This is used for any | |
66 // databases opened after calling this method to name UMA histograms and to | |
67 // name the background thread that might get started. | |
68 SetEnvironmentName(string name); | |
69 | |
70 // Open the database with the specified "name" in the specified "directory". | 65 // Open the database with the specified "name" in the specified "directory". |
71 // Fails if the database doesn't already exist. | 66 // Fails if the database doesn't already exist. |
72 Open(filesystem.mojom.Directory directory, | 67 Open(filesystem.mojom.Directory directory, |
73 string dbname, | 68 string dbname, |
74 associated LevelDBDatabase& database) => (DatabaseError status); | 69 associated LevelDBDatabase& database) => (DatabaseError status); |
75 | 70 |
76 // Open the database with the specified "name" in the specified "directory". | 71 // Open the database with the specified "name" in the specified "directory". |
77 OpenWithOptions(OpenOptions options, | 72 OpenWithOptions(OpenOptions options, |
78 filesystem.mojom.Directory directory, | 73 filesystem.mojom.Directory directory, |
79 string dbname, | 74 string dbname, |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
151 // Moves forward or backwards in iterator space. | 146 // Moves forward or backwards in iterator space. |
152 [Sync] | 147 [Sync] |
153 IteratorNext(mojo.common.mojom.UnguessableToken iterator) | 148 IteratorNext(mojo.common.mojom.UnguessableToken iterator) |
154 => (bool valid, DatabaseError status, array<uint8>? key, | 149 => (bool valid, DatabaseError status, array<uint8>? key, |
155 array<uint8>? value); | 150 array<uint8>? value); |
156 [Sync] | 151 [Sync] |
157 IteratorPrev(mojo.common.mojom.UnguessableToken iterator) | 152 IteratorPrev(mojo.common.mojom.UnguessableToken iterator) |
158 => (bool valid, DatabaseError status, array<uint8>? key, | 153 => (bool valid, DatabaseError status, array<uint8>? key, |
159 array<uint8>? value); | 154 array<uint8>? value); |
160 }; | 155 }; |
OLD | NEW |