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

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

Issue 336163005: Merge 276752 "Update OS version functions." (Closed) Base URL: svn://svn.chromium.org/chrome/branches/1985/src/
Patch Set: 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 417 matching lines...) Expand 10 before | Expand all | Expand 10 after
428 428
429 // === C++ operator new === 429 // === C++ operator new ===
430 430
431 void oom_killer_new() { 431 void oom_killer_new() {
432 debug::BreakDebugger(); 432 debug::BreakDebugger();
433 } 433 }
434 434
435 // === Core Foundation CFAllocators === 435 // === Core Foundation CFAllocators ===
436 436
437 bool CanGetContextForCFAllocator() { 437 bool CanGetContextForCFAllocator() {
438 return !base::mac::IsOSLaterThanMavericks_DontCallThis(); 438 return !base::mac::IsOSYosemiteOrLater();
439 } 439 }
440 440
441 CFAllocatorContext* ContextForCFAllocator(CFAllocatorRef allocator) { 441 CFAllocatorContext* ContextForCFAllocator(CFAllocatorRef allocator) {
442 if (base::mac::IsOSSnowLeopard()) { 442 if (base::mac::IsOSSnowLeopard()) {
443 ChromeCFAllocatorLeopards* our_allocator = 443 ChromeCFAllocatorLeopards* our_allocator =
444 const_cast<ChromeCFAllocatorLeopards*>( 444 const_cast<ChromeCFAllocatorLeopards*>(
445 reinterpret_cast<const ChromeCFAllocatorLeopards*>(allocator)); 445 reinterpret_cast<const ChromeCFAllocatorLeopards*>(allocator));
446 return &our_allocator->_context; 446 return &our_allocator->_context;
447 } else if (base::mac::IsOSLion() || 447 } else if (base::mac::IsOSLion() ||
448 base::mac::IsOSMountainLion() || 448 base::mac::IsOSMountainLion() ||
(...skipping 288 matching lines...) Expand 10 before | Expand all | Expand 10 after
737 @selector(allocWithZone:)); 737 @selector(allocWithZone:));
738 g_old_allocWithZone = reinterpret_cast<allocWithZone_t>( 738 g_old_allocWithZone = reinterpret_cast<allocWithZone_t>(
739 method_getImplementation(orig_method)); 739 method_getImplementation(orig_method));
740 CHECK(g_old_allocWithZone) 740 CHECK(g_old_allocWithZone)
741 << "Failed to get allocWithZone allocation function."; 741 << "Failed to get allocWithZone allocation function.";
742 method_setImplementation(orig_method, 742 method_setImplementation(orig_method,
743 reinterpret_cast<IMP>(oom_killer_allocWithZone)); 743 reinterpret_cast<IMP>(oom_killer_allocWithZone));
744 } 744 }
745 745
746 } // namespace base 746 } // 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