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

Side by Side Diff: mojo/shell/runner/host/mach_broker.cc

Issue 1877753003: Move mojo\shell to services\shell (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@62scan
Patch Set: . Created 4 years, 8 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
(Empty)
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
3 // found in the LICENSE file.
4
5 #include "mojo/shell/runner/host/mach_broker.h"
6
7 #include "base/logging.h"
8 #include "base/memory/singleton.h"
9
10 namespace mojo {
11 namespace shell {
12
13 namespace {
14 const char kBootstrapPortName[] = "mojo_shell";
15 }
16
17 // static
18 void MachBroker::SendTaskPortToParent() {
19 bool result = base::MachPortBroker::ChildSendTaskPortToParent(
20 kBootstrapPortName);
21 DCHECK(result);
22 }
23
24 // static
25 MachBroker* MachBroker::GetInstance() {
26 return base::Singleton<MachBroker>::get();
27 }
28
29 MachBroker::MachBroker() : broker_(kBootstrapPortName) {
30 bool result = broker_.Init();
31 DCHECK(result);
32 }
33
34 MachBroker::~MachBroker() {}
35
36 void MachBroker::ExpectPid(base::ProcessHandle pid) {
37 broker_.AddPlaceholderForPid(pid);
38 }
39
40 void MachBroker::RemovePid(base::ProcessHandle pid) {
41 broker_.InvalidatePid(pid);
42 }
43
44 } // namespace shell
45 } // namespace mojo
OLDNEW
« no previous file with comments | « mojo/shell/runner/host/mach_broker.h ('k') | mojo/shell/runner/host/native_application_support.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698