OLD | NEW |
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 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
78 // Register the port with the bootstrap server. Because bootstrap_register | 78 // Register the port with the bootstrap server. Because bootstrap_register |
79 // is deprecated, this has to be wraped in an ObjC interface. | 79 // is deprecated, this has to be wraped in an ObjC interface. |
80 NSPort* ns_port = [NSMachPort portWithMachPort:port | 80 NSPort* ns_port = [NSMachPort portWithMachPort:port |
81 options:NSMachPortDeallocateNone]; | 81 options:NSMachPortDeallocateNone]; |
82 NSString* name = base::SysUTF8ToNSString(broker_->GetMachPortName()); | 82 NSString* name = base::SysUTF8ToNSString(broker_->GetMachPortName()); |
83 return [[NSMachBootstrapServer sharedInstance] registerPort:ns_port | 83 return [[NSMachBootstrapServer sharedInstance] registerPort:ns_port |
84 name:name]; | 84 name:name]; |
85 } | 85 } |
86 | 86 |
87 // Implement |PlatformThread::Delegate|. | 87 // Implement |PlatformThread::Delegate|. |
88 virtual void ThreadMain() OVERRIDE { | 88 virtual void ThreadMain() override { |
89 MachBroker_ParentRecvMsg msg; | 89 MachBroker_ParentRecvMsg msg; |
90 bzero(&msg, sizeof(msg)); | 90 bzero(&msg, sizeof(msg)); |
91 msg.header.msgh_size = sizeof(msg); | 91 msg.header.msgh_size = sizeof(msg); |
92 msg.header.msgh_local_port = server_port_.get(); | 92 msg.header.msgh_local_port = server_port_.get(); |
93 | 93 |
94 const mach_msg_option_t options = MACH_RCV_MSG | | 94 const mach_msg_option_t options = MACH_RCV_MSG | |
95 MACH_RCV_TRAILER_TYPE(MACH_RCV_TRAILER_AUDIT) | | 95 MACH_RCV_TRAILER_TYPE(MACH_RCV_TRAILER_AUDIT) | |
96 MACH_RCV_TRAILER_ELEMENTS(MACH_RCV_TRAILER_AUDIT); | 96 MACH_RCV_TRAILER_ELEMENTS(MACH_RCV_TRAILER_AUDIT); |
97 | 97 |
98 kern_return_t kr; | 98 kern_return_t kr; |
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
290 NotificationService::AllBrowserContextsAndSources()); | 290 NotificationService::AllBrowserContextsAndSources()); |
291 registrar_.Add(this, NOTIFICATION_RENDERER_PROCESS_TERMINATED, | 291 registrar_.Add(this, NOTIFICATION_RENDERER_PROCESS_TERMINATED, |
292 NotificationService::AllBrowserContextsAndSources()); | 292 NotificationService::AllBrowserContextsAndSources()); |
293 | 293 |
294 // No corresponding StopObservingBrowserChildProcesses, | 294 // No corresponding StopObservingBrowserChildProcesses, |
295 // we leak this singleton. | 295 // we leak this singleton. |
296 BrowserChildProcessObserver::Add(this); | 296 BrowserChildProcessObserver::Add(this); |
297 } | 297 } |
298 | 298 |
299 } // namespace content | 299 } // namespace content |
OLD | NEW |