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

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

Issue 2271653006: base::mac::IsOSSierra() -> base::mac::IsOS10_12(), etc. (Closed) Base URL: https://chromium.googlesource.com/chromium/src@master
Patch Set: Nits Created 4 years, 3 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 | « sandbox/mac/bootstrap_sandbox_unittest.mm ('k') | sandbox/mac/os_compatibility.cc » ('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 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
47 return false; 47 return false;
48 } 48 }
49 sandbox_port_.reset(port); 49 sandbox_port_.reset(port);
50 if ((kr = mach_port_insert_right(task, sandbox_port_.get(), 50 if ((kr = mach_port_insert_right(task, sandbox_port_.get(),
51 sandbox_port_.get(), MACH_MSG_TYPE_MAKE_SEND) != KERN_SUCCESS)) { 51 sandbox_port_.get(), MACH_MSG_TYPE_MAKE_SEND) != KERN_SUCCESS)) {
52 MACH_LOG(ERROR, kr) << "Failed to allocate dummy sandbox port send right."; 52 MACH_LOG(ERROR, kr) << "Failed to allocate dummy sandbox port send right.";
53 return false; 53 return false;
54 } 54 }
55 sandbox_send_port_.reset(sandbox_port_.get()); 55 sandbox_send_port_.reset(sandbox_port_.get());
56 56
57 if (base::mac::IsOSYosemiteOrLater()) { 57 if (base::mac::IsAtLeastOS10_10()) {
58 message_server_.reset(new XPCMessageServer(this, server_receive_right)); 58 message_server_.reset(new XPCMessageServer(this, server_receive_right));
59 xpc_launchd_ = true; 59 xpc_launchd_ = true;
60 } else { 60 } else {
61 message_server_.reset( 61 message_server_.reset(
62 new MachMessageServer(this, server_receive_right, kBufferSize)); 62 new MachMessageServer(this, server_receive_right, kBufferSize));
63 } 63 }
64 return message_server_->Initialize(); 64 return message_server_->Initialize();
65 } 65 }
66 66
67 void LaunchdInterceptionServer::DemuxMessage(IPCMessage request) { 67 void LaunchdInterceptionServer::DemuxMessage(IPCMessage request) {
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
173 if (xpc_launchd_) { 173 if (xpc_launchd_) {
174 // xpc_dictionary_set_mach_send increments the send right count. 174 // xpc_dictionary_set_mach_send increments the send right count.
175 xpc_dictionary_set_mach_send(request.xpc, "domain-port", 175 xpc_dictionary_set_mach_send(request.xpc, "domain-port",
176 sandbox_->real_bootstrap_port()); 176 sandbox_->real_bootstrap_port());
177 } 177 }
178 178
179 message_server_->ForwardMessage(request, sandbox_->real_bootstrap_port()); 179 message_server_->ForwardMessage(request, sandbox_->real_bootstrap_port());
180 } 180 }
181 181
182 } // namespace sandbox 182 } // namespace sandbox
OLDNEW
« no previous file with comments | « sandbox/mac/bootstrap_sandbox_unittest.mm ('k') | sandbox/mac/os_compatibility.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698