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

Side by Side Diff: sandbox/mac/launchd_interception_server.cc

Issue 1556133002: Shutdown the sandbox MessageServer before deleting it. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 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 | sandbox/mac/mach_message_server.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "sandbox/mac/launchd_interception_server.h" 5 #include "sandbox/mac/launchd_interception_server.h"
6 6
7 #include <servers/bootstrap.h> 7 #include <servers/bootstrap.h>
8 #include <stddef.h> 8 #include <stddef.h>
9 #include <stdint.h> 9 #include <stdint.h>
10 10
(...skipping 14 matching lines...) Expand all
25 25
26 LaunchdInterceptionServer::LaunchdInterceptionServer( 26 LaunchdInterceptionServer::LaunchdInterceptionServer(
27 const BootstrapSandbox* sandbox) 27 const BootstrapSandbox* sandbox)
28 : sandbox_(sandbox), 28 : sandbox_(sandbox),
29 xpc_launchd_(false), 29 xpc_launchd_(false),
30 sandbox_port_(MACH_PORT_NULL), 30 sandbox_port_(MACH_PORT_NULL),
31 compat_shim_(OSCompatibility::CreateForPlatform()) { 31 compat_shim_(OSCompatibility::CreateForPlatform()) {
32 } 32 }
33 33
34 LaunchdInterceptionServer::~LaunchdInterceptionServer() { 34 LaunchdInterceptionServer::~LaunchdInterceptionServer() {
35 message_server_->Shutdown();
35 } 36 }
36 37
37 bool LaunchdInterceptionServer::Initialize(mach_port_t server_receive_right) { 38 bool LaunchdInterceptionServer::Initialize(mach_port_t server_receive_right) {
38 mach_port_t task = mach_task_self(); 39 mach_port_t task = mach_task_self();
39 kern_return_t kr; 40 kern_return_t kr;
40 41
41 // Allocate the dummy sandbox port. 42 // Allocate the dummy sandbox port.
42 mach_port_t port; 43 mach_port_t port;
43 if ((kr = mach_port_allocate(task, MACH_PORT_RIGHT_RECEIVE, &port)) != 44 if ((kr = mach_port_allocate(task, MACH_PORT_RIGHT_RECEIVE, &port)) !=
44 KERN_SUCCESS) { 45 KERN_SUCCESS) {
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after
172 if (xpc_launchd_) { 173 if (xpc_launchd_) {
173 // xpc_dictionary_set_mach_send increments the send right count. 174 // xpc_dictionary_set_mach_send increments the send right count.
174 xpc_dictionary_set_mach_send(request.xpc, "domain-port", 175 xpc_dictionary_set_mach_send(request.xpc, "domain-port",
175 sandbox_->real_bootstrap_port()); 176 sandbox_->real_bootstrap_port());
176 } 177 }
177 178
178 message_server_->ForwardMessage(request, sandbox_->real_bootstrap_port()); 179 message_server_->ForwardMessage(request, sandbox_->real_bootstrap_port());
179 } 180 }
180 181
181 } // namespace sandbox 182 } // namespace sandbox
OLDNEW
« no previous file with comments | « no previous file | sandbox/mac/mach_message_server.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698