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

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

Issue 2271653006: base::mac::IsOSSierra() -> base::mac::IsOS10_12(), etc. (Closed) Base URL: https://chromium.googlesource.com/chromium/src@master
Patch Set: Add SDK guards to blink, simplify how IsOS* are defined Created 4 years, 3 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
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 230 matching lines...) Expand 10 before | Expand all | Expand 10 after
241 241
242 void oom_killer_new() { 242 void oom_killer_new() {
243 TerminateBecauseOutOfMemory(0); 243 TerminateBecauseOutOfMemory(0);
244 } 244 }
245 245
246 #if !defined(ADDRESS_SANITIZER) 246 #if !defined(ADDRESS_SANITIZER)
247 247
248 // === Core Foundation CFAllocators === 248 // === Core Foundation CFAllocators ===
249 249
250 bool CanGetContextForCFAllocator() { 250 bool CanGetContextForCFAllocator() {
251 return !base::mac::IsOSLaterThanSierra_DontCallThis(); 251 return !base::mac::IsOSLaterThan10_12_DontCallThis();
252 } 252 }
253 253
254 CFAllocatorContext* ContextForCFAllocator(CFAllocatorRef allocator) { 254 CFAllocatorContext* ContextForCFAllocator(CFAllocatorRef allocator) {
255 ChromeCFAllocatorLions* our_allocator = 255 ChromeCFAllocatorLions* our_allocator =
256 const_cast<ChromeCFAllocatorLions*>( 256 const_cast<ChromeCFAllocatorLions*>(
257 reinterpret_cast<const ChromeCFAllocatorLions*>(allocator)); 257 reinterpret_cast<const ChromeCFAllocatorLions*>(allocator));
258 return &our_allocator->_context; 258 return &our_allocator->_context;
259 } 259 }
260 260
261 CFAllocatorAllocateCallBack g_old_cfallocator_system_default; 261 CFAllocatorAllocateCallBack g_old_cfallocator_system_default;
(...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after
542 @selector(allocWithZone:)); 542 @selector(allocWithZone:));
543 g_old_allocWithZone = reinterpret_cast<allocWithZone_t>( 543 g_old_allocWithZone = reinterpret_cast<allocWithZone_t>(
544 method_getImplementation(orig_method)); 544 method_getImplementation(orig_method));
545 CHECK(g_old_allocWithZone) 545 CHECK(g_old_allocWithZone)
546 << "Failed to get allocWithZone allocation function."; 546 << "Failed to get allocWithZone allocation function.";
547 method_setImplementation(orig_method, 547 method_setImplementation(orig_method,
548 reinterpret_cast<IMP>(oom_killer_allocWithZone)); 548 reinterpret_cast<IMP>(oom_killer_allocWithZone));
549 } 549 }
550 550
551 } // namespace base 551 } // namespace base
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698