Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(71)

Side by Side Diff: components/leveldb/leveldb_service_impl.h

Issue 1737933002: mojo leveldb: Get profile and leveldb connected to DOMStorageContext. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: jam's comments Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 "components/leveldb/leveldb_file_thread.h" 9 #include "components/leveldb/leveldb_file_thread.h"
10 #include "components/leveldb/public/interfaces/leveldb.mojom.h" 10 #include "components/leveldb/public/interfaces/leveldb.mojom.h"
11 #include "mojo/public/cpp/bindings/strong_binding.h"
11 12
12 namespace leveldb { 13 namespace leveldb {
13 14
14 // Creates LevelDBDatabases based scoped to a |directory|/|dbname|. 15 // Creates LevelDBDatabases based scoped to a |directory|/|dbname|.
15 class LevelDBServiceImpl : public LevelDBService { 16 class LevelDBServiceImpl : public LevelDBService {
16 public: 17 public:
17 LevelDBServiceImpl(); 18 LevelDBServiceImpl();
18 ~LevelDBServiceImpl() override; 19 ~LevelDBServiceImpl() override;
19 20
20 // Overridden from LevelDBService: 21 // Overridden from LevelDBService:
21 void Open(filesystem::DirectoryPtr directory, 22 void Open(filesystem::DirectoryPtr directory,
22 const mojo::String& dbname, 23 const mojo::String& dbname,
michaeln 2016/03/05 01:38:54 We might want this to accept relative filepaths to
23 mojo::InterfaceRequest<LevelDBDatabase> database, 24 mojo::InterfaceRequest<LevelDBDatabase> database,
24 const OpenCallback& callback) override; 25 const OpenCallback& callback) override;
25 26
26 private: 27 private:
27 // Thread to own the mojo message pipe. Because leveldb spawns multiple 28 // Thread to own the mojo message pipe. Because leveldb spawns multiple
28 // threads that want to call file stuff, we create a dedicated thread to send 29 // threads that want to call file stuff, we create a dedicated thread to send
29 // and receive mojo message calls. 30 // and receive mojo message calls.
30 scoped_refptr<LevelDBFileThread> thread_; 31 scoped_refptr<LevelDBFileThread> thread_;
31 32
32 DISALLOW_COPY_AND_ASSIGN(LevelDBServiceImpl); 33 DISALLOW_COPY_AND_ASSIGN(LevelDBServiceImpl);
33 }; 34 };
34 35
35 } // namespace leveldb 36 } // namespace leveldb
36 37
37 #endif // COMPONENTS_LEVELDB_LEVELDB_SERVICE_IMPL_H_ 38 #endif // COMPONENTS_LEVELDB_LEVELDB_SERVICE_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698