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

Unified Diff: base/process_util_mac.mm

Issue 9701031: Add preliminary OOM support for Mountain Lion. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: tweak comments Created 8 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « base/mac/mac_util_unittest.mm ('k') | base/process_util_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/process_util_mac.mm
diff --git a/base/process_util_mac.mm b/base/process_util_mac.mm
index a451a9525ee6592d8e7fcfd5e42bca7516ea397b..dce02398e1d44fcfe3029854e407ae6718a2583e 100644
--- a/base/process_util_mac.mm
+++ b/base/process_util_mac.mm
@@ -718,8 +718,16 @@ void oom_killer_new() {
// === Core Foundation CFAllocators ===
bool CanGetContextForCFAllocator() {
- // TODO(rsesek|avi): See mac_util.h:153 for removing/updating this.
- return !base::mac::IsOSLaterThanLion();
+ // TODO(avi): remove at final release; http://crbug.com/117476
+ if (base::mac::IsOSMountainLion()) {
+ NSLog(@"Unsure about the internals of CFAllocator but going to patch them "
+ "anyway. If there is a crash inside of CFAllocatorAllocate, please "
+ "report it at http://crbug.com/117476 . If there is a crash and it "
+ "is NOT inside of CFAllocatorAllocate, it is NOT RELATED. DO NOT "
+ "REPORT IT THERE but rather FILE A NEW BUG.");
+ }
+ return !base::mac::
+ IsOSDangerouslyLaterThanMountainLionForUseByCFAllocatorReplacement();
}
CFAllocatorContext* ContextForCFAllocator(CFAllocatorRef allocator) {
@@ -728,10 +736,10 @@ CFAllocatorContext* ContextForCFAllocator(CFAllocatorRef allocator) {
const_cast<ChromeCFAllocatorLeopards*>(
reinterpret_cast<const ChromeCFAllocatorLeopards*>(allocator));
return &our_allocator->_context;
- } else if (base::mac::IsOSLion()) {
- ChromeCFAllocatorLion* our_allocator =
- const_cast<ChromeCFAllocatorLion*>(
- reinterpret_cast<const ChromeCFAllocatorLion*>(allocator));
+ } else if (base::mac::IsOSLion() || base::mac::IsOSMountainLion()) {
+ ChromeCFAllocatorLions* our_allocator =
+ const_cast<ChromeCFAllocatorLions*>(
+ reinterpret_cast<const ChromeCFAllocatorLions*>(allocator));
return &our_allocator->_context;
} else {
return NULL;
« no previous file with comments | « base/mac/mac_util_unittest.mm ('k') | base/process_util_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698