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

Side by Side Diff: mojo/shell/context.cc

Issue 599733007: Allow passing listening socket path on command line (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 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 | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "mojo/shell/context.h" 5 #include "mojo/shell/context.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after
178 new TaskRunners(base::MessageLoop::current()->message_loop_proxy())); 178 new TaskRunners(base::MessageLoop::current()->message_loop_proxy()));
179 179
180 for (size_t i = 0; i < arraysize(kLocalMojoURLs); ++i) 180 for (size_t i = 0; i < arraysize(kLocalMojoURLs); ++i)
181 mojo_url_resolver_.AddLocalFileMapping(GURL(kLocalMojoURLs[i])); 181 mojo_url_resolver_.AddLocalFileMapping(GURL(kLocalMojoURLs[i]));
182 182
183 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); 183 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess();
184 184
185 if (command_line->HasSwitch(switches::kEnableExternalApplications)) { 185 if (command_line->HasSwitch(switches::kEnableExternalApplications)) {
186 listener_ = ExternalApplicationListener::Create( 186 listener_ = ExternalApplicationListener::Create(
187 task_runners_->shell_runner(), task_runners_->io_runner()); 187 task_runners_->shell_runner(), task_runners_->io_runner());
188
189 base::FilePath socket_path =
190 command_line->GetSwitchValuePath(switches::kEnableExternalApplications);
191 if (socket_path.empty())
192 socket_path = ExternalApplicationListener::ConstructDefaultSocketPath();
193
188 listener_->ListenInBackground( 194 listener_->ListenInBackground(
189 ExternalApplicationListener::ConstructDefaultSocketPath(), 195 socket_path,
190 base::Bind(&ApplicationManager::RegisterExternalApplication, 196 base::Bind(&ApplicationManager::RegisterExternalApplication,
191 base::Unretained(&application_manager_))); 197 base::Unretained(&application_manager_)));
192 } 198 }
193 scoped_ptr<DynamicServiceRunnerFactory> runner_factory; 199 scoped_ptr<DynamicServiceRunnerFactory> runner_factory;
194 if (command_line->HasSwitch(switches::kEnableMultiprocess)) 200 if (command_line->HasSwitch(switches::kEnableMultiprocess))
195 runner_factory.reset(new OutOfProcessDynamicServiceRunnerFactory()); 201 runner_factory.reset(new OutOfProcessDynamicServiceRunnerFactory());
196 else 202 else
197 runner_factory.reset(new InProcessDynamicServiceRunnerFactory()); 203 runner_factory.reset(new InProcessDynamicServiceRunnerFactory());
198 204
199 DynamicApplicationLoader* dynamic_application_loader = 205 DynamicApplicationLoader* dynamic_application_loader =
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
262 ScopedMessagePipeHandle Context::ConnectToServiceByName( 268 ScopedMessagePipeHandle Context::ConnectToServiceByName(
263 const GURL& application_url, 269 const GURL& application_url,
264 const std::string& service_name) { 270 const std::string& service_name) {
265 app_urls_.insert(application_url); 271 app_urls_.insert(application_url);
266 return application_manager_.ConnectToServiceByName( 272 return application_manager_.ConnectToServiceByName(
267 application_url, service_name).Pass(); 273 application_url, service_name).Pass();
268 } 274 }
269 275
270 } // namespace shell 276 } // namespace shell
271 } // namespace mojo 277 } // namespace mojo
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698