From bb88fdd5d7fc502dedb685ab5f37a8eab85fd0e3 Mon Sep 17 00:00:00 2001 From: Bob Owen Date: Thu, 31 Jul 2014 11:06:23 +0100 Subject: [PATCH] Bug 1045646 - Part 5: Remove AutoPushJSContext. r=bholley --- js/xpconnect/src/nsCxPusher.cpp | 7 ------- js/xpconnect/src/nsCxPusher.h | 23 ----------------------- 2 files changed, 30 deletions(-) diff --git a/js/xpconnect/src/nsCxPusher.cpp b/js/xpconnect/src/nsCxPusher.cpp index 34d2e4d1b03a..b19b3b413338 100644 --- a/js/xpconnect/src/nsCxPusher.cpp +++ b/js/xpconnect/src/nsCxPusher.cpp @@ -254,11 +254,4 @@ ThreadsafeAutoSafeJSContext::operator JSContext*() const } } -AutoPushJSContext::AutoPushJSContext(JSContext *aCx) : mCx(aCx) -{ - if (mCx && mCx != nsXPConnect::XPConnect()->GetCurrentJSContext()) { - mPusher.construct(mCx); - } -} - } // namespace mozilla diff --git a/js/xpconnect/src/nsCxPusher.h b/js/xpconnect/src/nsCxPusher.h index 1ee654b999c3..9b6e67274fd5 100644 --- a/js/xpconnect/src/nsCxPusher.h +++ b/js/xpconnect/src/nsCxPusher.h @@ -155,29 +155,6 @@ private: MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER }; -/** - * Use AutoPushJSContext when you want to use a specific JSContext that may or - * may not be already on the stack. This differs from nsCxPusher in that it only - * pushes in the case that the given cx is not the active cx on the JSContext - * stack, which avoids an expensive JS_SaveFrameChain in the common case. - * - * Most consumers of this should probably just use AutoJSContext. But the goal - * here is to preserve the existing behavior while ensure proper cx-stack - * semantics in edge cases where the context being used doesn't match the active - * context. - * - * NB: This will not push a null cx even if aCx is null. Make sure you know what - * you're doing. - */ -class MOZ_STACK_CLASS AutoPushJSContext { - Maybe mPusher; - JSContext* mCx; - -public: - explicit AutoPushJSContext(JSContext* aCx); - operator JSContext*() { return mCx; } -}; - } // namespace mozilla #endif /* nsCxPusher_h */