Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 #ifndef COMPONENTS_LEVELDB_UTIL_H_ | 5 #ifndef COMPONENTS_LEVELDB_PUBLIC_CPP_UTIL_H_ |
| 6 #define COMPONENTS_LEVELDB_UTIL_H_ | 6 #define COMPONENTS_LEVELDB_PUBLIC_CPP_UTIL_H_ |
| 7 | 7 |
| 8 #include "components/leveldb/public/interfaces/leveldb.mojom.h" | 8 #include "components/leveldb/public/interfaces/leveldb.mojom.h" |
| 9 | 9 |
| 10 namespace leveldb { | 10 namespace leveldb { |
| 11 | 11 |
| 12 class Slice; | 12 class Slice; |
| 13 class Status; | 13 class Status; |
| 14 | 14 |
| 15 DatabaseError LeveldbStatusToError(const leveldb::Status& s); | 15 DatabaseError LeveldbStatusToError(const leveldb::Status& s); |
| 16 | 16 |
| 17 leveldb::Status DatabaseErrorToStatus(DatabaseError e, | |
|
jam
2016/04/07 16:06:01
nit: please add a comment for all these public met
| |
| 18 const Slice& msg, | |
| 19 const Slice& msg2); | |
| 20 | |
| 17 // Builds a Slice pointing to the data inside |a|. This is not a type-converter | 21 // Builds a Slice pointing to the data inside |a|. This is not a type-converter |
| 18 // as it is not a copy operation; the returned Slice points into |a| and must | 22 // as it is not a copy operation; the returned Slice points into |a| and must |
| 19 // outlive |a|. | 23 // outlive |a|. |
| 20 leveldb::Slice GetSliceFor(const mojo::Array<uint8_t>& a); | 24 leveldb::Slice GetSliceFor(const mojo::Array<uint8_t>& a); |
| 21 | 25 |
| 26 mojo::Array<uint8_t> GetArrayFor(const leveldb::Slice& s); | |
| 27 | |
| 22 } // namespace leveldb | 28 } // namespace leveldb |
| 23 | 29 |
| 24 #endif // COMPONENTS_LEVELDB_UTIL_H_ | 30 #endif // COMPONENTS_LEVELDB_PUBLIC_CPP_UTIL_H_ |
| OLD | NEW |