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

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

Issue 2850743004: Replace ServiceInfo with BindSourceInfo. (Closed)
Patch Set: . Created 3 years, 7 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
« no previous file with comments | « components/leveldb/leveldb_app.h ('k') | components/nacl/common/nacl_service.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "components/leveldb/leveldb_service_impl.h" 7 #include "components/leveldb/leveldb_service_impl.h"
8 #include "services/service_manager/public/cpp/service_context.h" 8 #include "services/service_manager/public/cpp/service_context.h"
9 9
10 namespace leveldb { 10 namespace leveldb {
11 11
12 LevelDBApp::LevelDBApp() : file_thread_("LevelDBFile") { 12 LevelDBApp::LevelDBApp() : file_thread_("LevelDBFile") {
13 registry_.AddInterface<mojom::LevelDBService>(this); 13 registry_.AddInterface<mojom::LevelDBService>(this);
14 } 14 }
15 15
16 LevelDBApp::~LevelDBApp() {} 16 LevelDBApp::~LevelDBApp() {}
17 17
18 void LevelDBApp::OnStart() { 18 void LevelDBApp::OnStart() {
19 tracing_.Initialize(context()->connector(), context()->identity().name()); 19 tracing_.Initialize(context()->connector(), context()->identity().name());
20 } 20 }
21 21
22 void LevelDBApp::OnBindInterface( 22 void LevelDBApp::OnBindInterface(
23 const service_manager::ServiceInfo& source_info, 23 const service_manager::BindSourceInfo& source_info,
24 const std::string& interface_name, 24 const std::string& interface_name,
25 mojo::ScopedMessagePipeHandle interface_pipe) { 25 mojo::ScopedMessagePipeHandle interface_pipe) {
26 registry_.BindInterface(source_info.identity, interface_name, 26 registry_.BindInterface(source_info.identity, interface_name,
27 std::move(interface_pipe)); 27 std::move(interface_pipe));
28 } 28 }
29 29
30 void LevelDBApp::Create(const service_manager::Identity& remote_identity, 30 void LevelDBApp::Create(const service_manager::Identity& remote_identity,
31 leveldb::mojom::LevelDBServiceRequest request) { 31 leveldb::mojom::LevelDBServiceRequest request) {
32 if (!service_) { 32 if (!service_) {
33 if (!file_thread_.IsRunning()) 33 if (!file_thread_.IsRunning())
34 file_thread_.Start(); 34 file_thread_.Start();
35 service_.reset( 35 service_.reset(
36 new LevelDBServiceImpl(file_thread_.message_loop()->task_runner())); 36 new LevelDBServiceImpl(file_thread_.message_loop()->task_runner()));
37 } 37 }
38 bindings_.AddBinding(service_.get(), std::move(request)); 38 bindings_.AddBinding(service_.get(), std::move(request));
39 } 39 }
40 40
41 } // namespace leveldb 41 } // namespace leveldb
OLDNEW
« no previous file with comments | « components/leveldb/leveldb_app.h ('k') | components/nacl/common/nacl_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698