From 534e0458e116e2ca40fa6ed0b2ef48c0e2b80d91 Mon Sep 17 00:00:00 2001 From: Bobby Holley Date: Thu, 13 Jun 2013 10:09:25 -0700 Subject: [PATCH] Bug 880917 - Remove AutoVersionChecker. r=luke Looks like cdleary added this back in bug 595691, as an equivalence to some even-older-and-more-overly-cautious XBL code that was saving and restoring the version across XBL calls. It doesn't seem like this should be an issue anymore, and it's just a debugging aid to boot. Let's kill it. --- content/xbl/src/nsXBLProtoImpl.cpp | 25 ------------------------- 1 file changed, 25 deletions(-) diff --git a/content/xbl/src/nsXBLProtoImpl.cpp b/content/xbl/src/nsXBLProtoImpl.cpp index 9d97766c2f3..db6eefebcc9 100644 --- a/content/xbl/src/nsXBLProtoImpl.cpp +++ b/content/xbl/src/nsXBLProtoImpl.cpp @@ -21,27 +21,6 @@ using namespace mozilla; -// Checks that the version is not modified in a given scope. -class AutoVersionChecker -{ - DebugOnly const cx; - DebugOnly versionBefore; - -public: - explicit AutoVersionChecker(JSContext *aCx) : cx(aCx) { -#ifdef DEBUG - versionBefore = JS_GetVersion(cx); -#endif - } - - ~AutoVersionChecker() { -#ifdef DEBUG - JSVersion versionAfter = JS_GetVersion(cx); - NS_ABORT_IF_FALSE(versionAfter == versionBefore, "version must not change"); -#endif - } -}; - nsresult nsXBLProtoImpl::InstallImplementation(nsXBLPrototypeBinding* aPrototypeBinding, nsXBLBinding* aBinding) @@ -89,7 +68,6 @@ nsXBLProtoImpl::InstallImplementation(nsXBLPrototypeBinding* aPrototypeBinding, AutoPushJSContext cx(context->GetNativeContext()); JSAutoCompartment ac(cx, targetClassObject); - AutoVersionChecker avc(cx); // Walk our member list and install each one in turn. for (nsXBLProtoImplMember* curr = mMembers; @@ -229,8 +207,6 @@ nsXBLProtoImpl::CompilePrototypeMembers(nsXBLPrototypeBinding* aBinding) MOZ_ASSERT(classObject); mClassObject = classObject; - AutoVersionChecker avc(cx); - // Now that we have a class object installed, we walk our member list and compile each of our // properties and methods in turn. for (nsXBLProtoImplMember* curr = mMembers; @@ -299,7 +275,6 @@ nsXBLProtoImpl::FindField(const nsString& aFieldName) const bool nsXBLProtoImpl::ResolveAllFields(JSContext *cx, JS::Handle obj) const { - AutoVersionChecker avc(cx); for (nsXBLProtoImplField* f = mFields; f; f = f->GetNext()) { // Using OBJ_LOOKUP_PROPERTY is a pain, since what we have is a // PRUnichar* for the property name. Let's just use the public API and