| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_PROTO_PROTO_DATABASE_IMPL_H_ | 5 #ifndef COMPONENTS_LEVELDB_PROTO_PROTO_DATABASE_IMPL_H_ |
| 6 #define COMPONENTS_LEVELDB_PROTO_PROTO_DATABASE_IMPL_H_ | 6 #define COMPONENTS_LEVELDB_PROTO_PROTO_DATABASE_IMPL_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| 11 #include "base/bind.h" | 11 #include "base/bind.h" |
| 12 #include "base/files/file_path.h" | 12 #include "base/files/file_path.h" |
| 13 #include "base/macros.h" |
| 13 #include "base/memory/scoped_ptr.h" | 14 #include "base/memory/scoped_ptr.h" |
| 14 #include "base/message_loop/message_loop.h" | 15 #include "base/message_loop/message_loop.h" |
| 15 #include "base/sequenced_task_runner.h" | 16 #include "base/sequenced_task_runner.h" |
| 17 #include "base/strings/string_split.h" |
| 16 #include "base/strings/string_util.h" | 18 #include "base/strings/string_util.h" |
| 17 #include "base/threading/sequenced_worker_pool.h" | 19 #include "base/threading/sequenced_worker_pool.h" |
| 18 #include "base/threading/thread_checker.h" | 20 #include "base/threading/thread_checker.h" |
| 19 #include "base/strings/string_split.h" | |
| 20 #include "components/leveldb_proto/leveldb_database.h" | 21 #include "components/leveldb_proto/leveldb_database.h" |
| 21 #include "components/leveldb_proto/proto_database.h" | 22 #include "components/leveldb_proto/proto_database.h" |
| 22 | 23 |
| 23 namespace leveldb_proto { | 24 namespace leveldb_proto { |
| 24 | 25 |
| 25 using KeyValueVector = base::StringPairs; | 26 using KeyValueVector = base::StringPairs; |
| 26 using KeyVector = std::vector<std::string>; | 27 using KeyVector = std::vector<std::string>; |
| 27 | 28 |
| 28 // When the ProtoDatabaseImpl instance is deleted, in-progress asynchronous | 29 // When the ProtoDatabaseImpl instance is deleted, in-progress asynchronous |
| 29 // operations will be completed and the corresponding callbacks will be called. | 30 // operations will be completed and the corresponding callbacks will be called. |
| (...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 238 task_runner_->PostTaskAndReply( | 239 task_runner_->PostTaskAndReply( |
| 239 FROM_HERE, base::Bind(LoadEntriesFromTaskRunner<T>, | 240 FROM_HERE, base::Bind(LoadEntriesFromTaskRunner<T>, |
| 240 base::Unretained(db_.get()), entries_ptr, success), | 241 base::Unretained(db_.get()), entries_ptr, success), |
| 241 base::Bind(RunLoadCallback<T>, callback, base::Owned(success), | 242 base::Bind(RunLoadCallback<T>, callback, base::Owned(success), |
| 242 base::Passed(&entries))); | 243 base::Passed(&entries))); |
| 243 } | 244 } |
| 244 | 245 |
| 245 } // namespace leveldb_proto | 246 } // namespace leveldb_proto |
| 246 | 247 |
| 247 #endif // COMPONENTS_LEVELDB_PROTO_PROTO_DATABASE_IMPL_H_ | 248 #endif // COMPONENTS_LEVELDB_PROTO_PROTO_DATABASE_IMPL_H_ |
| OLD | NEW |