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

Side by Side Diff: content/browser/mach_broker_mac.mm

Issue 1411523006: mac: Make Mach port scopers better ScopedGenerics (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Update Created 5 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
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 "content/browser/mach_broker_mac.h" 5 #include "content/browser/mach_broker_mac.h"
6 6
7 #include <bsm/libbsm.h> 7 #include <bsm/libbsm.h>
8 #include <servers/bootstrap.h> 8 #include <servers/bootstrap.h>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after
193 msg.header.msgh_local_port = server_port_.get(); 193 msg.header.msgh_local_port = server_port_.get();
194 194
195 const mach_msg_option_t options = MACH_RCV_MSG | 195 const mach_msg_option_t options = MACH_RCV_MSG |
196 MACH_RCV_TRAILER_TYPE(MACH_RCV_TRAILER_AUDIT) | 196 MACH_RCV_TRAILER_TYPE(MACH_RCV_TRAILER_AUDIT) |
197 MACH_RCV_TRAILER_ELEMENTS(MACH_RCV_TRAILER_AUDIT); 197 MACH_RCV_TRAILER_ELEMENTS(MACH_RCV_TRAILER_AUDIT);
198 198
199 kern_return_t kr = mach_msg(&msg.header, 199 kern_return_t kr = mach_msg(&msg.header,
200 options, 200 options,
201 0, 201 0,
202 sizeof(msg), 202 sizeof(msg),
203 server_port_, 203 server_port_.get(),
204 MACH_MSG_TIMEOUT_NONE, 204 MACH_MSG_TIMEOUT_NONE,
205 MACH_PORT_NULL); 205 MACH_PORT_NULL);
206 if (kr != KERN_SUCCESS) { 206 if (kr != KERN_SUCCESS) {
207 MACH_LOG(ERROR, kr) << "mach_msg"; 207 MACH_LOG(ERROR, kr) << "mach_msg";
208 return; 208 return;
209 } 209 }
210 210
211 // Use the kernel audit information to make sure this message is from 211 // Use the kernel audit information to make sure this message is from
212 // a task that this process spawned. The kernel audit token contains the 212 // a task that this process spawned. The kernel audit token contains the
213 // unspoofable pid of the task that sent the message. 213 // unspoofable pid of the task that sent the message.
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
262 NotificationService::AllBrowserContextsAndSources()); 262 NotificationService::AllBrowserContextsAndSources());
263 registrar_.Add(this, NOTIFICATION_RENDERER_PROCESS_TERMINATED, 263 registrar_.Add(this, NOTIFICATION_RENDERER_PROCESS_TERMINATED,
264 NotificationService::AllBrowserContextsAndSources()); 264 NotificationService::AllBrowserContextsAndSources());
265 265
266 // No corresponding StopObservingBrowserChildProcesses, 266 // No corresponding StopObservingBrowserChildProcesses,
267 // we leak this singleton. 267 // we leak this singleton.
268 BrowserChildProcessObserver::Add(this); 268 BrowserChildProcessObserver::Add(this);
269 } 269 }
270 270
271 } // namespace content 271 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/browser_io_surface_manager_mac.cc ('k') | content/child/child_io_surface_manager_mac.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698