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

Side by Side Diff: services/service_manager/standalone/context.cc

Issue 2573283002: Use a static catalog manifest for the standalone Mash runner (Closed)
Patch Set: . Created 3 years, 11 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/service_manager/standalone/context.h" 5 #include "services/service_manager/standalone/context.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <utility> 10 #include <utility>
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after
154 mojo::edk::SetMachPortProvider(MachBroker::GetInstance()->port_provider()); 154 mojo::edk::SetMachPortProvider(MachBroker::GetInstance()->port_provider());
155 #endif 155 #endif
156 } 156 }
157 157
158 std::unique_ptr<ServiceProcessLauncherFactory> 158 std::unique_ptr<ServiceProcessLauncherFactory>
159 service_process_launcher_factory = 159 service_process_launcher_factory =
160 base::MakeUnique<ServiceProcessLauncherFactoryImpl>( 160 base::MakeUnique<ServiceProcessLauncherFactoryImpl>(
161 blocking_pool_.get(), 161 blocking_pool_.get(),
162 init_params ? init_params->service_process_launcher_delegate 162 init_params ? init_params->service_process_launcher_delegate
163 : nullptr); 163 : nullptr);
164 std::unique_ptr<catalog::Store> store; 164 if (init_params && init_params->static_catalog) {
165 if (init_params) 165 catalog_.reset(
166 store = std::move(init_params->catalog_store); 166 new catalog::Catalog(std::move(init_params->static_catalog)));
167 catalog_.reset( 167 } else {
168 new catalog::Catalog(blocking_pool_.get(), std::move(store), nullptr)); 168 catalog_.reset(
169 new catalog::Catalog(blocking_pool_.get(), nullptr));
170 }
169 service_manager_.reset( 171 service_manager_.reset(
170 new ServiceManager(std::move(service_process_launcher_factory), 172 new ServiceManager(std::move(service_process_launcher_factory),
171 catalog_->TakeService())); 173 catalog_->TakeService()));
172 174
173 if (command_line.HasSwitch(::switches::kServiceOverrides)) { 175 if (command_line.HasSwitch(::switches::kServiceOverrides)) {
174 base::FilePath overrides_file(GetPathFromCommandLineSwitch( 176 base::FilePath overrides_file(GetPathFromCommandLineSwitch(
175 command_line.GetSwitchValueASCII(::switches::kServiceOverrides))); 177 command_line.GetSwitchValueASCII(::switches::kServiceOverrides)));
176 JSONFileValueDeserializer deserializer(overrides_file); 178 JSONFileValueDeserializer deserializer(overrides_file);
177 int error = 0; 179 int error = 0;
178 std::string message; 180 std::string message;
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
266 mojom::InterfaceProviderPtr local_interfaces; 268 mojom::InterfaceProviderPtr local_interfaces;
267 269
268 std::unique_ptr<ConnectParams> params(new ConnectParams); 270 std::unique_ptr<ConnectParams> params(new ConnectParams);
269 params->set_source(CreateServiceManagerIdentity()); 271 params->set_source(CreateServiceManagerIdentity());
270 params->set_target(Identity(name, mojom::kRootUserID)); 272 params->set_target(Identity(name, mojom::kRootUserID));
271 params->set_remote_interfaces(mojo::MakeRequest(&remote_interfaces)); 273 params->set_remote_interfaces(mojo::MakeRequest(&remote_interfaces));
272 service_manager_->Connect(std::move(params)); 274 service_manager_->Connect(std::move(params));
273 } 275 }
274 276
275 } // namespace service_manager 277 } // namespace service_manager
OLDNEW
« no previous file with comments | « services/service_manager/standalone/context.h ('k') | services/service_manager/standalone/desktop/launcher_process.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698