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

Unified Diff: chrome/common/mac/objc_zombie.mm

Issue 7826016: [Mac] Enable CrZombie for all processes. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Whitespace, and verify merge. Created 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/common/mac/objc_zombie.h ('k') | chrome/common/mac/objc_zombie_unittest.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/common/mac/objc_zombie.mm
diff --git a/chrome/browser/ui/cocoa/objc_zombie.mm b/chrome/common/mac/objc_zombie.mm
similarity index 98%
copy from chrome/browser/ui/cocoa/objc_zombie.mm
copy to chrome/common/mac/objc_zombie.mm
index ea892daa3a660052ee8a1f55b60258493de97c39..c60981bd7a84a2d74ff53f7c70323b5ca0e4f8fa 100644
--- a/chrome/browser/ui/cocoa/objc_zombie.mm
+++ b/chrome/common/mac/objc_zombie.mm
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#import "chrome/browser/ui/cocoa/objc_zombie.h"
+#import "chrome/common/mac/objc_zombie.h"
#include <dlfcn.h>
#include <execinfo.h>
@@ -20,7 +20,7 @@
#include "base/metrics/histogram.h"
#include "base/synchronization/lock.h"
#import "chrome/app/breakpad_mac.h"
-#import "chrome/browser/ui/cocoa/objc_method_swizzle.h"
+#import "chrome/common/mac/objc_method_swizzle.h"
// Deallocated objects are re-classed as |CrZombie|. No superclass
// because then the class would have to override many/most of the
@@ -446,21 +446,21 @@ BOOL ZombieInit() {
namespace ObjcEvilDoers {
-BOOL ZombieEnable(BOOL zombieAllObjects,
+bool ZombieEnable(bool zombieAllObjects,
size_t zombieCount) {
// Only allow enable/disable on the main thread, just to keep things
// simple.
CHECK([NSThread isMainThread]);
if (!ZombieInit())
- return NO;
+ return false;
g_zombieAllObjects = zombieAllObjects;
// Replace the implementation of -[NSObject dealloc].
Method m = class_getInstanceMethod([NSObject class], @selector(dealloc));
if (!m)
- return NO;
+ return false;
const IMP prevDeallocIMP = method_setImplementation(m, (IMP)ZombieDealloc);
DCHECK(prevDeallocIMP == g_originalDeallocIMP ||
@@ -491,7 +491,7 @@ BOOL ZombieEnable(BOOL zombieAllObjects,
g_zombieCount = oldCount;
g_zombieIndex = oldIndex;
ZombieDisable();
- return NO;
+ return false;
}
}
@@ -521,7 +521,7 @@ BOOL ZombieEnable(BOOL zombieAllObjects,
free(oldZombies);
}
- return YES;
+ return true;
}
void ZombieDisable() {
« no previous file with comments | « chrome/common/mac/objc_zombie.h ('k') | chrome/common/mac/objc_zombie_unittest.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698