| 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 785 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 796 | 796 |
| 797 // === C++ operator new === | 797 // === C++ operator new === |
| 798 | 798 |
| 799 void oom_killer_new() { | 799 void oom_killer_new() { |
| 800 debug::BreakDebugger(); | 800 debug::BreakDebugger(); |
| 801 } | 801 } |
| 802 | 802 |
| 803 // === Core Foundation CFAllocators === | 803 // === Core Foundation CFAllocators === |
| 804 | 804 |
| 805 bool CanGetContextForCFAllocator() { | 805 bool CanGetContextForCFAllocator() { |
| 806 return !base::mac:: | 806 return !base::mac::IsOSLaterThanMountainLion_DontCallThis(); |
| 807 IsOSDangerouslyLaterThanMountainLionForUseByCFAllocatorReplacement(); | |
| 808 } | 807 } |
| 809 | 808 |
| 810 CFAllocatorContext* ContextForCFAllocator(CFAllocatorRef allocator) { | 809 CFAllocatorContext* ContextForCFAllocator(CFAllocatorRef allocator) { |
| 811 if (base::mac::IsOSSnowLeopard()) { | 810 if (base::mac::IsOSSnowLeopard()) { |
| 812 ChromeCFAllocatorLeopards* our_allocator = | 811 ChromeCFAllocatorLeopards* our_allocator = |
| 813 const_cast<ChromeCFAllocatorLeopards*>( | 812 const_cast<ChromeCFAllocatorLeopards*>( |
| 814 reinterpret_cast<const ChromeCFAllocatorLeopards*>(allocator)); | 813 reinterpret_cast<const ChromeCFAllocatorLeopards*>(allocator)); |
| 815 return &our_allocator->_context; | 814 return &our_allocator->_context; |
| 816 } else if (base::mac::IsOSLion() || base::mac::IsOSMountainLion()) { | 815 } else if (base::mac::IsOSLion() || base::mac::IsOSMountainLion()) { |
| 817 ChromeCFAllocatorLions* our_allocator = | 816 ChromeCFAllocatorLions* our_allocator = |
| (...skipping 421 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1239 } | 1238 } |
| 1240 } | 1239 } |
| 1241 | 1240 |
| 1242 } // namespace | 1241 } // namespace |
| 1243 | 1242 |
| 1244 void EnsureProcessTerminated(ProcessHandle process) { | 1243 void EnsureProcessTerminated(ProcessHandle process) { |
| 1245 WaitForChildToDie(process, kWaitBeforeKillSeconds); | 1244 WaitForChildToDie(process, kWaitBeforeKillSeconds); |
| 1246 } | 1245 } |
| 1247 | 1246 |
| 1248 } // namespace base | 1247 } // namespace base |
| OLD | NEW |