| 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 "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 700 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 711 | 711 |
| 712 // === C++ operator new === | 712 // === C++ operator new === |
| 713 | 713 |
| 714 void oom_killer_new() { | 714 void oom_killer_new() { |
| 715 debug::BreakDebugger(); | 715 debug::BreakDebugger(); |
| 716 } | 716 } |
| 717 | 717 |
| 718 // === Core Foundation CFAllocators === | 718 // === Core Foundation CFAllocators === |
| 719 | 719 |
| 720 bool CanGetContextForCFAllocator() { | 720 bool CanGetContextForCFAllocator() { |
| 721 return !base::mac::IsOSLaterThanLion(); | 721 return !base::mac::IsOSDangerouslyLaterThanMountainLionForUseByCFAllocatorRepl
acement(); |
| 722 } | 722 } |
| 723 | 723 |
| 724 CFAllocatorContext* ContextForCFAllocator(CFAllocatorRef allocator) { | 724 CFAllocatorContext* ContextForCFAllocator(CFAllocatorRef allocator) { |
| 725 if (base::mac::IsOSLeopard() || base::mac::IsOSSnowLeopard()) { | 725 if (base::mac::IsOSLeopard() || base::mac::IsOSSnowLeopard()) { |
| 726 ChromeCFAllocatorLeopards* our_allocator = | 726 ChromeCFAllocatorLeopards* our_allocator = |
| 727 const_cast<ChromeCFAllocatorLeopards*>( | 727 const_cast<ChromeCFAllocatorLeopards*>( |
| 728 reinterpret_cast<const ChromeCFAllocatorLeopards*>(allocator)); | 728 reinterpret_cast<const ChromeCFAllocatorLeopards*>(allocator)); |
| 729 return &our_allocator->_context; | 729 return &our_allocator->_context; |
| 730 } else if (base::mac::IsOSLion()) { | 730 } else if (base::mac::IsOSLion()) { |
| 731 ChromeCFAllocatorLion* our_allocator = | 731 ChromeCFAllocatorLion* our_allocator = |
| (...skipping 411 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1143 } | 1143 } |
| 1144 } | 1144 } |
| 1145 | 1145 |
| 1146 } // namespace | 1146 } // namespace |
| 1147 | 1147 |
| 1148 void EnsureProcessTerminated(ProcessHandle process) { | 1148 void EnsureProcessTerminated(ProcessHandle process) { |
| 1149 WaitForChildToDie(process, kWaitBeforeKillSeconds); | 1149 WaitForChildToDie(process, kWaitBeforeKillSeconds); |
| 1150 } | 1150 } |
| 1151 | 1151 |
| 1152 } // namespace base | 1152 } // namespace base |
| OLD | NEW |