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

Side by Side Diff: components/leveldb/leveldb_app.cc

Issue 1737933002: mojo leveldb: Get profile and leveldb connected to DOMStorageContext. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove stray mark. 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 #include "components/leveldb/leveldb_app.h" 5 #include "components/leveldb/leveldb_app.h"
6 6
7 #include "base/message_loop/message_loop.h"
7 #include "components/leveldb/leveldb_service_impl.h" 8 #include "components/leveldb/leveldb_service_impl.h"
8 #include "mojo/shell/public/cpp/connection.h" 9 #include "mojo/shell/public/cpp/connection.h"
9 10
10 namespace leveldb { 11 namespace leveldb {
11 12
12 LevelDBApp::LevelDBApp() {} 13 LevelDBApp::LevelDBApp() {}
13 14
14 LevelDBApp::~LevelDBApp() {} 15 LevelDBApp::~LevelDBApp() {}
15 16
16 void LevelDBApp::Initialize(mojo::Connector* connector, 17 void LevelDBApp::Initialize(mojo::Connector* connector,
17 const mojo::Identity& identity, 18 const mojo::Identity& identity,
18 uint32_t id) { 19 uint32_t id) {
19 tracing_.Initialize(connector, identity.name()); 20 tracing_.Initialize(connector, identity.name());
20 service_.reset(new LevelDBServiceImpl);
21 } 21 }
22 22
23 bool LevelDBApp::AcceptConnection(mojo::Connection* connection) { 23 bool LevelDBApp::AcceptConnection(mojo::Connection* connection) {
24 connection->AddInterface<LevelDBService>(this); 24 connection->AddInterface<LevelDBService>(this);
25 return true; 25 return true;
26 } 26 }
27 27
28 void LevelDBApp::ShellConnectionLost() { 28 void LevelDBApp::ShellConnectionLost() {
29 // TODO: This should exit cleanly. 29 // TODO: This should exit cleanly.
30 _exit(1); 30 _exit(1);
michaeln 2016/03/17 22:35:41 do we ever expect to get here in chrome? is this e
Elliot Glaysher 2016/03/18 19:41:12 This is not linked into chrome. (I don't actually
31 } 31 }
32 32
33 void LevelDBApp::Create(mojo::Connection* connection, 33 void LevelDBApp::Create(mojo::Connection* connection,
34 mojo::InterfaceRequest<LevelDBService> request) { 34 leveldb::LevelDBServiceRequest request) {
35 if (!service_)
36 service_.reset(new LevelDBServiceImpl);
35 bindings_.AddBinding(service_.get(), std::move(request)); 37 bindings_.AddBinding(service_.get(), std::move(request));
36 } 38 }
37 39
38 } // namespace leveldb 40 } // namespace leveldb
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698