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

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

Issue 1722743002: Adds ability for chrome to behave as mojo_runner (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: chrome_mash, package_mash_services and NativeRunnerDelegate Created 4 years, 10 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/application_manager.h" 5 #include "mojo/shell/application_manager.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 8
9 #include <utility> 9 #include <utility>
10 10
(...skipping 316 matching lines...) Expand 10 before | Expand all | Expand 10 after
327 if (!base_filter.is_null()) 327 if (!base_filter.is_null())
328 capability_filter = base_filter->filter.To<CapabilityFilter>(); 328 capability_filter = base_filter->filter.To<CapabilityFilter>();
329 329
330 CreateShellClient(source, 330 CreateShellClient(source,
331 Identity(resolved_gurl, qualifier, capability_filter), 331 Identity(resolved_gurl, qualifier, capability_filter),
332 target.url(), std::move(request)); 332 target.url(), std::move(request));
333 } else { 333 } else {
334 bool start_sandboxed = false; 334 bool start_sandboxed = false;
335 base::FilePath path = util::UrlToFilePath(file_url.To<GURL>()); 335 base::FilePath path = util::UrlToFilePath(file_url.To<GURL>());
336 scoped_ptr<NativeRunner> runner = native_runner_factory_->Create(path); 336 scoped_ptr<NativeRunner> runner = native_runner_factory_->Create(path);
337 runner->Start(path, start_sandboxed, std::move(request), 337 runner->Start(path, target, start_sandboxed, std::move(request),
338 base::Bind(&ApplicationManager::ApplicationPIDAvailable, 338 base::Bind(&ApplicationManager::ApplicationPIDAvailable,
339 weak_ptr_factory_.GetWeakPtr(), instance->id()), 339 weak_ptr_factory_.GetWeakPtr(), instance->id()),
340 base::Bind(&ApplicationManager::CleanupRunner, 340 base::Bind(&ApplicationManager::CleanupRunner,
341 weak_ptr_factory_.GetWeakPtr(), runner.get())); 341 weak_ptr_factory_.GetWeakPtr(), runner.get()));
342 instance->SetNativeRunner(runner.get()); 342 instance->SetNativeRunner(runner.get());
343 native_runners_.push_back(std::move(runner)); 343 native_runners_.push_back(std::move(runner));
344 } 344 }
345 } 345 }
346 346
347 bool ApplicationManager::LoadWithLoader(const Identity& target, 347 bool ApplicationManager::LoadWithLoader(const Identity& target,
(...skipping 29 matching lines...) Expand all
377 info->qualifier = instance->identity().qualifier(); 377 info->qualifier = instance->identity().qualifier();
378 if (instance->identity().url().spec() == "mojo://shell/") 378 if (instance->identity().url().spec() == "mojo://shell/")
379 info->pid = base::Process::Current().Pid(); 379 info->pid = base::Process::Current().Pid();
380 else 380 else
381 info->pid = instance->pid(); 381 info->pid = instance->pid();
382 return info; 382 return info;
383 } 383 }
384 384
385 } // namespace shell 385 } // namespace shell
386 } // namespace mojo 386 } // namespace mojo
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698