Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(569)

Side by Side Diff: base/process/memory_mac.mm

Issue 325423005: Update OS version functions. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: d'oh Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « base/mac/mac_util_unittest.mm ('k') | base/test/expectations/expectation.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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/memory.h" 5 #include "base/process/memory.h"
6 6
7 #include <CoreFoundation/CoreFoundation.h> 7 #include <CoreFoundation/CoreFoundation.h>
8 #include <errno.h> 8 #include <errno.h>
9 #include <mach/mach.h> 9 #include <mach/mach.h>
10 #include <mach/mach_vm.h> 10 #include <mach/mach_vm.h>
(...skipping 420 matching lines...) Expand 10 before | Expand all | Expand 10 after
431 431
432 // === C++ operator new === 432 // === C++ operator new ===
433 433
434 void oom_killer_new() { 434 void oom_killer_new() {
435 debug::BreakDebugger(); 435 debug::BreakDebugger();
436 } 436 }
437 437
438 // === Core Foundation CFAllocators === 438 // === Core Foundation CFAllocators ===
439 439
440 bool CanGetContextForCFAllocator() { 440 bool CanGetContextForCFAllocator() {
441 return !base::mac::IsOSLaterThanMavericks_DontCallThis(); 441 return !base::mac::IsOSYosemiteOrLater();
442 } 442 }
443 443
444 CFAllocatorContext* ContextForCFAllocator(CFAllocatorRef allocator) { 444 CFAllocatorContext* ContextForCFAllocator(CFAllocatorRef allocator) {
445 if (base::mac::IsOSSnowLeopard()) { 445 if (base::mac::IsOSSnowLeopard()) {
446 ChromeCFAllocatorLeopards* our_allocator = 446 ChromeCFAllocatorLeopards* our_allocator =
447 const_cast<ChromeCFAllocatorLeopards*>( 447 const_cast<ChromeCFAllocatorLeopards*>(
448 reinterpret_cast<const ChromeCFAllocatorLeopards*>(allocator)); 448 reinterpret_cast<const ChromeCFAllocatorLeopards*>(allocator));
449 return &our_allocator->_context; 449 return &our_allocator->_context;
450 } else if (base::mac::IsOSLion() || 450 } else if (base::mac::IsOSLion() ||
451 base::mac::IsOSMountainLion() || 451 base::mac::IsOSMountainLion() ||
(...skipping 288 matching lines...) Expand 10 before | Expand all | Expand 10 after
740 @selector(allocWithZone:)); 740 @selector(allocWithZone:));
741 g_old_allocWithZone = reinterpret_cast<allocWithZone_t>( 741 g_old_allocWithZone = reinterpret_cast<allocWithZone_t>(
742 method_getImplementation(orig_method)); 742 method_getImplementation(orig_method));
743 CHECK(g_old_allocWithZone) 743 CHECK(g_old_allocWithZone)
744 << "Failed to get allocWithZone allocation function."; 744 << "Failed to get allocWithZone allocation function.";
745 method_setImplementation(orig_method, 745 method_setImplementation(orig_method,
746 reinterpret_cast<IMP>(oom_killer_allocWithZone)); 746 reinterpret_cast<IMP>(oom_killer_allocWithZone));
747 } 747 }
748 748
749 } // namespace base 749 } // namespace base
OLDNEW
« no previous file with comments | « base/mac/mac_util_unittest.mm ('k') | base/test/expectations/expectation.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698