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

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

Issue 1917973002: mac: Remove IsOSLion(). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: tapted Created 4 years, 8 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
« no previous file with comments | « base/mac/mac_util_unittest.mm ('k') | chrome/app_shim/chrome_main_app_mode_mac.mm » ('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 234 matching lines...) Expand 10 before | Expand all | Expand 10 after
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::IsOSLaterThanElCapitan_DontCallThis(); 251 return !base::mac::IsOSLaterThanElCapitan_DontCallThis();
252 } 252 }
253 253
254 CFAllocatorContext* ContextForCFAllocator(CFAllocatorRef allocator) { 254 CFAllocatorContext* ContextForCFAllocator(CFAllocatorRef allocator) {
255 if (base::mac::IsOSLion() || base::mac::IsOSMountainLion() || 255 if (base::mac::IsOSMountainLion() ||
256 base::mac::IsOSMavericks() || base::mac::IsOSYosemite() || 256 base::mac::IsOSMavericks() || base::mac::IsOSYosemite() ||
257 base::mac::IsOSElCapitan()) { 257 base::mac::IsOSElCapitan()) {
258 ChromeCFAllocatorLions* our_allocator = 258 ChromeCFAllocatorLions* our_allocator =
259 const_cast<ChromeCFAllocatorLions*>( 259 const_cast<ChromeCFAllocatorLions*>(
260 reinterpret_cast<const ChromeCFAllocatorLions*>(allocator)); 260 reinterpret_cast<const ChromeCFAllocatorLions*>(allocator));
261 return &our_allocator->_context; 261 return &our_allocator->_context;
262 } else { 262 } else {
263 return NULL; 263 return NULL;
264 } 264 }
265 } 265 }
(...skipping 282 matching lines...) Expand 10 before | Expand all | Expand 10 after
548 @selector(allocWithZone:)); 548 @selector(allocWithZone:));
549 g_old_allocWithZone = reinterpret_cast<allocWithZone_t>( 549 g_old_allocWithZone = reinterpret_cast<allocWithZone_t>(
550 method_getImplementation(orig_method)); 550 method_getImplementation(orig_method));
551 CHECK(g_old_allocWithZone) 551 CHECK(g_old_allocWithZone)
552 << "Failed to get allocWithZone allocation function."; 552 << "Failed to get allocWithZone allocation function.";
553 method_setImplementation(orig_method, 553 method_setImplementation(orig_method,
554 reinterpret_cast<IMP>(oom_killer_allocWithZone)); 554 reinterpret_cast<IMP>(oom_killer_allocWithZone));
555 } 555 }
556 556
557 } // namespace base 557 } // namespace base
OLDNEW
« no previous file with comments | « base/mac/mac_util_unittest.mm ('k') | chrome/app_shim/chrome_main_app_mode_mac.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698