Chromium Code Reviews| Index: chrome/browser/chrome_browser_application_mac.mm |
| diff --git a/chrome/browser/chrome_browser_application_mac.mm b/chrome/browser/chrome_browser_application_mac.mm |
| index 3ee3dae68ed706525a6da87b4227d937c0644d6b..ee88fa83719ed97d0e2f21f11ac359225d526238 100644 |
| --- a/chrome/browser/chrome_browser_application_mac.mm |
| +++ b/chrome/browser/chrome_browser_application_mac.mm |
| @@ -196,6 +196,19 @@ BOOL SwizzleNSExceptionInit() { |
| return YES; |
| } |
| +// Failures for purposes of monitoring success setting up zombies. |
| +enum ZombieFailure { |
| + FAILED_10_5, |
| + FAILED_10_6, |
| + |
| + // Add new versions before here. |
| + FAILED_MAX, |
| +}; |
| + |
| +void RecordZombieFailure(ZombieFailure failure) { |
| + UMA_HISTOGRAM_ENUMERATION("OSX.ZombieEnableFailure", failure, FAILED_MAX); |
|
Mark Mentovai
2011/06/07 21:42:57
I don’t remember if you need to edit some file to
Scott Hess - ex-Googler
2011/06/07 23:48:21
They're reported as hashes, so you need to tell an
|
| +} |
| + |
| } // namespace |
| @implementation BrowserCrApplication |
| @@ -205,10 +218,32 @@ BOOL SwizzleNSExceptionInit() { |
| int32 major_version = 0, minor_version = 0, bugfix_version = 0; |
| base::SysInfo::OperatingSystemVersionNumbers( |
| &major_version, &minor_version, &bugfix_version); |
| - if (major_version == 10 && (minor_version == 5 || minor_version == 6)) { |
| - // Turn all deallocated Objective-C objects into zombies, keeping |
| - // the most recent 10,000 of them on the treadmill. |
| - ObjcEvilDoers::ZombieEnable(YES, 10000); |
| + |
| + // Turn all deallocated Objective-C objects into zombies, keeping |
| + // the most recent 10,000 of them on the treadmill. |
| + static const size_t kTreadmillSize = 10000; |
| + if (major_version == 10) { |
| + if (minor_version == 5) { |
| + if (!ObjcEvilDoers::ZombieEnable(ObjcEvilDoers::RUNTIME_10_5, YES, |
| + kTreadmillSize)) { |
| + RecordZombieFailure(FAILED_10_5); |
| + } |
| + } else if (minor_version == 6) { |
| + if (!ObjcEvilDoers::ZombieEnable(ObjcEvilDoers::RUNTIME_10_6, YES, |
| + kTreadmillSize)) { |
| + RecordZombieFailure(FAILED_10_6); |
| + } |
| + } else if (minor_version > 6) { |
| + // Assume the future looks like the present. |
| + if (!ObjcEvilDoers::ZombieEnable(ObjcEvilDoers::RUNTIME_10_6, YES, |
| + kTreadmillSize)) { |
| + // Put all future failures into the MAX bin. New OS releases |
| + // come out infrequently enough that this should always |
| + // correspond to "Next release", and once the next release |
| + // happens that bin will get an official name. |
| + RecordZombieFailure(FAILED_MAX); |
| + } |
| + } |
|
Scott Hess - ex-Googler
2011/06/07 21:24:51
I am not really happy with this code. But it wasn
Mark Mentovai
2011/06/07 21:42:57
shess wrote:
|
| } |
| } |