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

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

Issue 2419723002: Move services/shell to services/service_manager (Closed)
Patch Set: rebase Created 4 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
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 "services/shell/runner/host/mach_broker.h"
6
7 #include "base/logging.h"
8 #include "base/memory/singleton.h"
9
10 namespace shell {
11
12 namespace {
13 const char kBootstrapPortName[] = "mojo_shell";
14 }
15
16 // static
17 void MachBroker::SendTaskPortToParent() {
18 bool result = base::MachPortBroker::ChildSendTaskPortToParent(
19 kBootstrapPortName);
20 DCHECK(result);
21 }
22
23 // static
24 MachBroker* MachBroker::GetInstance() {
25 return base::Singleton<MachBroker>::get();
26 }
27
28 MachBroker::MachBroker() : broker_(kBootstrapPortName) {
29 bool result = broker_.Init();
30 DCHECK(result);
31 }
32
33 MachBroker::~MachBroker() {}
34
35 void MachBroker::ExpectPid(base::ProcessHandle pid) {
36 broker_.AddPlaceholderForPid(pid);
37 }
38
39 void MachBroker::RemovePid(base::ProcessHandle pid) {
40 broker_.InvalidatePid(pid);
41 }
42
43 } // namespace shell
OLDNEW
« no previous file with comments | « services/shell/runner/host/mach_broker.h ('k') | services/shell/runner/host/native_library_runner.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698