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 801 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
812 | 812 |
813 // === C++ operator new === | 813 // === C++ operator new === |
814 | 814 |
815 void oom_killer_new() { | 815 void oom_killer_new() { |
816 debug::BreakDebugger(); | 816 debug::BreakDebugger(); |
817 } | 817 } |
818 | 818 |
819 // === Core Foundation CFAllocators === | 819 // === Core Foundation CFAllocators === |
820 | 820 |
821 bool CanGetContextForCFAllocator() { | 821 bool CanGetContextForCFAllocator() { |
822 return !base::mac::IsOSLaterThanMountainLion_DontCallThis(); | 822 return !base::mac:: |
| 823 IsOSDangerouslyLaterThanMountainLionForUseByCFAllocatorReplacement(); |
823 } | 824 } |
824 | 825 |
825 CFAllocatorContext* ContextForCFAllocator(CFAllocatorRef allocator) { | 826 CFAllocatorContext* ContextForCFAllocator(CFAllocatorRef allocator) { |
826 if (base::mac::IsOSSnowLeopard()) { | 827 if (base::mac::IsOSSnowLeopard()) { |
827 ChromeCFAllocatorLeopards* our_allocator = | 828 ChromeCFAllocatorLeopards* our_allocator = |
828 const_cast<ChromeCFAllocatorLeopards*>( | 829 const_cast<ChromeCFAllocatorLeopards*>( |
829 reinterpret_cast<const ChromeCFAllocatorLeopards*>(allocator)); | 830 reinterpret_cast<const ChromeCFAllocatorLeopards*>(allocator)); |
830 return &our_allocator->_context; | 831 return &our_allocator->_context; |
831 } else if (base::mac::IsOSLion() || base::mac::IsOSMountainLion()) { | 832 } else if (base::mac::IsOSLion() || base::mac::IsOSMountainLion()) { |
832 ChromeCFAllocatorLions* our_allocator = | 833 ChromeCFAllocatorLions* our_allocator = |
(...skipping 421 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1254 } | 1255 } |
1255 } | 1256 } |
1256 | 1257 |
1257 } // namespace | 1258 } // namespace |
1258 | 1259 |
1259 void EnsureProcessTerminated(ProcessHandle process) { | 1260 void EnsureProcessTerminated(ProcessHandle process) { |
1260 WaitForChildToDie(process, kWaitBeforeKillSeconds); | 1261 WaitForChildToDie(process, kWaitBeforeKillSeconds); |
1261 } | 1262 } |
1262 | 1263 |
1263 } // namespace base | 1264 } // namespace base |
OLD | NEW |