OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "base/process_util.h" | 5 #include "base/process_util.h" |
6 | 6 |
7 #import <Cocoa/Cocoa.h> | 7 #import <Cocoa/Cocoa.h> |
8 #include <crt_externs.h> | 8 #include <crt_externs.h> |
9 #include <dlfcn.h> | 9 #include <dlfcn.h> |
10 #include <errno.h> | 10 #include <errno.h> |
(...skipping 757 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
768 } | 768 } |
769 | 769 |
770 // === Core Foundation CFAllocators === | 770 // === Core Foundation CFAllocators === |
771 | 771 |
772 bool CanGetContextForCFAllocator() { | 772 bool CanGetContextForCFAllocator() { |
773 return !base::mac:: | 773 return !base::mac:: |
774 IsOSDangerouslyLaterThanMountainLionForUseByCFAllocatorReplacement(); | 774 IsOSDangerouslyLaterThanMountainLionForUseByCFAllocatorReplacement(); |
775 } | 775 } |
776 | 776 |
777 CFAllocatorContext* ContextForCFAllocator(CFAllocatorRef allocator) { | 777 CFAllocatorContext* ContextForCFAllocator(CFAllocatorRef allocator) { |
778 if (base::mac::IsOSLeopard() || base::mac::IsOSSnowLeopard()) { | 778 if (base::mac::IsOSSnowLeopardOrEarlier()) { |
779 ChromeCFAllocatorLeopards* our_allocator = | 779 ChromeCFAllocatorLeopards* our_allocator = |
780 const_cast<ChromeCFAllocatorLeopards*>( | 780 const_cast<ChromeCFAllocatorLeopards*>( |
781 reinterpret_cast<const ChromeCFAllocatorLeopards*>(allocator)); | 781 reinterpret_cast<const ChromeCFAllocatorLeopards*>(allocator)); |
782 return &our_allocator->_context; | 782 return &our_allocator->_context; |
783 } else if (base::mac::IsOSLion() || base::mac::IsOSMountainLion()) { | 783 } else if (base::mac::IsOSLion() || base::mac::IsOSMountainLion()) { |
784 ChromeCFAllocatorLions* our_allocator = | 784 ChromeCFAllocatorLions* our_allocator = |
785 const_cast<ChromeCFAllocatorLions*>( | 785 const_cast<ChromeCFAllocatorLions*>( |
786 reinterpret_cast<const ChromeCFAllocatorLions*>(allocator)); | 786 reinterpret_cast<const ChromeCFAllocatorLions*>(allocator)); |
787 return &our_allocator->_context; | 787 return &our_allocator->_context; |
788 } else { | 788 } else { |
(...skipping 420 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1209 } | 1209 } |
1210 } | 1210 } |
1211 | 1211 |
1212 } // namespace | 1212 } // namespace |
1213 | 1213 |
1214 void EnsureProcessTerminated(ProcessHandle process) { | 1214 void EnsureProcessTerminated(ProcessHandle process) { |
1215 WaitForChildToDie(process, kWaitBeforeKillSeconds); | 1215 WaitForChildToDie(process, kWaitBeforeKillSeconds); |
1216 } | 1216 } |
1217 | 1217 |
1218 } // namespace base | 1218 } // namespace base |
OLD | NEW |