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

Unified Diff: chrome/browser/ui/cocoa/objc_zombie.h

Issue 7084017: [Mac] Use object_destructInstance() if available. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Per-runtime initialization, unit test, misc. Created 9 years, 6 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
Index: chrome/browser/ui/cocoa/objc_zombie.h
diff --git a/chrome/browser/ui/cocoa/objc_zombie.h b/chrome/browser/ui/cocoa/objc_zombie.h
index 714409e7e244f931833455296c19d7084abe7367..fbc748e47851e180143a3de2dd016723557c598c 100644
--- a/chrome/browser/ui/cocoa/objc_zombie.h
+++ b/chrome/browser/ui/cocoa/objc_zombie.h
@@ -12,6 +12,15 @@
// namespace.
namespace ObjcEvilDoers {
+// Which version of the runtime to expect when initializing. This
+// decision is left to the caller so that unit tests and production
+// uses can make different decisions.
+enum Runtime {
+ RUNTIME_GUESS,
Mark Mentovai 2011/06/07 21:42:57 This is only used in test code. Seems like you dup
Scott Hess - ex-Googler 2011/06/07 23:48:21 RUNTIME_10_x is for the specific runtime, while RU
+ RUNTIME_10_5,
+ RUNTIME_10_6,
+};
+
// Enable zombie object debugging. This implements a variant of Apple's
// NSZombieEnabled which can help expose use-after-free errors where messages
// are sent to freed Objective-C objects in production builds.
@@ -25,7 +34,7 @@ namespace ObjcEvilDoers {
// |zombieCount| controls how many zombies to store before freeing the
// oldest. Set to 0 to free objects immediately after making them
// zombies.
-BOOL ZombieEnable(BOOL zombieAllObjects, size_t zombieCount);
+BOOL ZombieEnable(Runtime runtime, BOOL zombieAllObjects, size_t zombieCount);
// Disable zombies.
void ZombieDisable();

Powered by Google App Engine
This is Rietveld 408576698