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

Side by Side Diff: services/catalog/catalog.cc

Issue 2592623002: mojo:: Introduce InterfaceRequest ctor that takes in InterfacePtr* (Closed)
Patch Set: Rebase + response to review Created 3 years, 12 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 | « mojo/public/cpp/bindings/tests/pickle_unittest.cc ('k') | services/navigation/view_impl.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 "services/catalog/catalog.h" 5 #include "services/catalog/catalog.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/files/file_path.h" 8 #include "base/files/file_path.h"
9 #include "base/files/scoped_temp_dir.h" 9 #include "base/files/scoped_temp_dir.h"
10 #include "base/macros.h" 10 #include "base/macros.h"
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
108 const std::string& package_name) { 108 const std::string& package_name) {
109 system_reader_->OverridePackageName(service_name, package_name); 109 system_reader_->OverridePackageName(service_name, package_name);
110 } 110 }
111 111
112 service_manager::mojom::ServicePtr Catalog::TakeService() { 112 service_manager::mojom::ServicePtr Catalog::TakeService() {
113 return std::move(service_); 113 return std::move(service_);
114 } 114 }
115 115
116 Catalog::Catalog(std::unique_ptr<Store> store) 116 Catalog::Catalog(std::unique_ptr<Store> store)
117 : store_(std::move(store)), weak_factory_(this) { 117 : store_(std::move(store)), weak_factory_(this) {
118 service_manager::mojom::ServiceRequest request = MakeRequest(&service_); 118 service_manager::mojom::ServiceRequest request(&service_);
119 service_context_.reset(new service_manager::ServiceContext( 119 service_context_.reset(new service_manager::ServiceContext(
120 base::MakeUnique<ServiceImpl>(this), std::move(request))); 120 base::MakeUnique<ServiceImpl>(this), std::move(request)));
121 } 121 }
122 122
123 void Catalog::ScanSystemPackageDir() { 123 void Catalog::ScanSystemPackageDir() {
124 base::FilePath system_package_dir; 124 base::FilePath system_package_dir;
125 PathService::Get(base::DIR_MODULE, &system_package_dir); 125 PathService::Get(base::DIR_MODULE, &system_package_dir);
126 system_package_dir = system_package_dir.AppendASCII(kPackagesDirName); 126 system_package_dir = system_package_dir.AppendASCII(kPackagesDirName);
127 system_reader_->Read(system_package_dir, &system_cache_, 127 system_reader_->Read(system_package_dir, &system_cache_,
128 base::Bind(&Catalog::SystemPackageDirScanned, 128 base::Bind(&Catalog::SystemPackageDirScanned,
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
181 return instance; 181 return instance;
182 } 182 }
183 183
184 void Catalog::SystemPackageDirScanned() { 184 void Catalog::SystemPackageDirScanned() {
185 loaded_ = true; 185 loaded_ = true;
186 for (auto& instance : instances_) 186 for (auto& instance : instances_)
187 instance.second->CacheReady(&system_cache_); 187 instance.second->CacheReady(&system_cache_);
188 } 188 }
189 189
190 } // namespace catalog 190 } // namespace catalog
OLDNEW
« no previous file with comments | « mojo/public/cpp/bindings/tests/pickle_unittest.cc ('k') | services/navigation/view_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698