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

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: merge to tip of tree Created 4 years, 9 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 320 matching lines...) Expand 10 before | Expand all | Expand 10 after
331 // In cases where a package alias is resolved, we have to use the qualifier 331 // In cases where a package alias is resolved, we have to use the qualifier
332 // from the original request rather than for the package itself, which will 332 // from the original request rather than for the package itself, which will
333 // always be the same. 333 // always be the same.
334 CreateShellClient(source, 334 CreateShellClient(source,
335 Identity(resolved_gurl, target.qualifier(), filter), 335 Identity(resolved_gurl, target.qualifier(), filter),
336 target.url(), std::move(request)); 336 target.url(), std::move(request));
337 } else { 337 } else {
338 bool start_sandboxed = false; 338 bool start_sandboxed = false;
339 base::FilePath path = util::UrlToFilePath(file_url.To<GURL>()); 339 base::FilePath path = util::UrlToFilePath(file_url.To<GURL>());
340 scoped_ptr<NativeRunner> runner = native_runner_factory_->Create(path); 340 scoped_ptr<NativeRunner> runner = native_runner_factory_->Create(path);
341 runner->Start(path, start_sandboxed, std::move(request), 341 runner->Start(path, target, start_sandboxed, std::move(request),
342 base::Bind(&ApplicationManager::ApplicationPIDAvailable, 342 base::Bind(&ApplicationManager::ApplicationPIDAvailable,
343 weak_ptr_factory_.GetWeakPtr(), instance->id()), 343 weak_ptr_factory_.GetWeakPtr(), instance->id()),
344 base::Bind(&ApplicationManager::CleanupRunner, 344 base::Bind(&ApplicationManager::CleanupRunner,
345 weak_ptr_factory_.GetWeakPtr(), runner.get())); 345 weak_ptr_factory_.GetWeakPtr(), runner.get()));
346 instance->SetNativeRunner(runner.get()); 346 instance->SetNativeRunner(runner.get());
347 native_runners_.push_back(std::move(runner)); 347 native_runners_.push_back(std::move(runner));
348 } 348 }
349 } 349 }
350 350
351 bool ApplicationManager::LoadWithLoader(const Identity& target, 351 bool ApplicationManager::LoadWithLoader(const Identity& target,
(...skipping 29 matching lines...) Expand all
381 info->qualifier = instance->identity().qualifier(); 381 info->qualifier = instance->identity().qualifier();
382 if (instance->identity().url().spec() == "mojo://shell/") 382 if (instance->identity().url().spec() == "mojo://shell/")
383 info->pid = base::Process::Current().Pid(); 383 info->pid = base::Process::Current().Pid();
384 else 384 else
385 info->pid = instance->pid(); 385 info->pid = instance->pid();
386 return info; 386 return info;
387 } 387 }
388 388
389 } // namespace shell 389 } // namespace shell
390 } // namespace mojo 390 } // namespace mojo
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698