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_LEVELDB_SERVICE_IMPL_H_ | 5 #ifndef COMPONENTS_LEVELDB_LEVELDB_SERVICE_IMPL_H_ |
6 #define COMPONENTS_LEVELDB_LEVELDB_SERVICE_IMPL_H_ | 6 #define COMPONENTS_LEVELDB_LEVELDB_SERVICE_IMPL_H_ |
7 | 7 |
8 #include "base/memory/ref_counted.h" | 8 #include "base/memory/ref_counted.h" |
| 9 #include "base/single_thread_task_runner.h" |
9 #include "components/leveldb/leveldb_mojo_proxy.h" | 10 #include "components/leveldb/leveldb_mojo_proxy.h" |
10 #include "components/leveldb/public/interfaces/leveldb.mojom.h" | 11 #include "components/leveldb/public/interfaces/leveldb.mojom.h" |
11 #include "mojo/public/cpp/bindings/binding_set.h" | 12 #include "mojo/public/cpp/bindings/binding_set.h" |
12 | 13 |
13 namespace leveldb { | 14 namespace leveldb { |
14 | 15 |
15 // Creates LevelDBDatabases based scoped to a |directory|/|dbname|. | 16 // Creates LevelDBDatabases based scoped to a |directory|/|dbname|. |
16 class LevelDBServiceImpl : public mojom::LevelDBService { | 17 class LevelDBServiceImpl : public mojom::LevelDBService { |
17 public: | 18 public: |
18 // The |file_task_runner| is used to run tasks to interact with the | 19 // The |file_task_runner| is used to run tasks to interact with the |
(...skipping 25 matching lines...) Expand all Loading... |
44 // threads that want to call file stuff, we create a dedicated thread to send | 45 // threads that want to call file stuff, we create a dedicated thread to send |
45 // and receive mojo message calls. | 46 // and receive mojo message calls. |
46 scoped_refptr<LevelDBMojoProxy> thread_; | 47 scoped_refptr<LevelDBMojoProxy> thread_; |
47 | 48 |
48 DISALLOW_COPY_AND_ASSIGN(LevelDBServiceImpl); | 49 DISALLOW_COPY_AND_ASSIGN(LevelDBServiceImpl); |
49 }; | 50 }; |
50 | 51 |
51 } // namespace leveldb | 52 } // namespace leveldb |
52 | 53 |
53 #endif // COMPONENTS_LEVELDB_LEVELDB_SERVICE_IMPL_H_ | 54 #endif // COMPONENTS_LEVELDB_LEVELDB_SERVICE_IMPL_H_ |
OLD | NEW |