From 552eed87ec86ce466b3078a78053ef3c312f013e Mon Sep 17 00:00:00 2001 From: Eric Faust Date: Thu, 29 May 2014 15:07:19 -0700 Subject: [PATCH] Bug 1017862 - Remove virtual destructor from BaseProxyHandler. (r=jorendorff) --- js/ipc/WrapperOwner.cpp | 1 - js/src/jsproxy.cpp | 11 +---------- js/src/jsproxy.h | 2 +- js/src/jswrapper.cpp | 8 -------- js/src/jswrapper.h | 4 ---- js/xpconnect/wrappers/FilteringWrapper.cpp | 5 ----- js/xpconnect/wrappers/FilteringWrapper.h | 1 - js/xpconnect/wrappers/WaiveXrayWrapper.cpp | 4 ---- js/xpconnect/wrappers/WaiveXrayWrapper.h | 1 - js/xpconnect/wrappers/XrayWrapper.cpp | 5 ----- js/xpconnect/wrappers/XrayWrapper.h | 1 - 11 files changed, 2 insertions(+), 41 deletions(-) diff --git a/js/ipc/WrapperOwner.cpp b/js/ipc/WrapperOwner.cpp index ac360974765..f5d0b315971 100644 --- a/js/ipc/WrapperOwner.cpp +++ b/js/ipc/WrapperOwner.cpp @@ -52,7 +52,6 @@ class CPOWProxyHandler : public BaseProxyHandler public: CPOWProxyHandler() : BaseProxyHandler(&sCPOWProxyHandler) {} - virtual ~CPOWProxyHandler() {} virtual bool finalizeInBackground(Value priv) MOZ_OVERRIDE { return false; diff --git a/js/src/jsproxy.cpp b/js/src/jsproxy.cpp index 20871a99de0..921de0bc602 100644 --- a/js/src/jsproxy.cpp +++ b/js/src/jsproxy.cpp @@ -88,6 +88,7 @@ BaseProxyHandler::BaseProxyHandler(const void *family) BaseProxyHandler::~BaseProxyHandler() { + MOZ_RELEASE_ASSERT(!JSRuntime::hasLiveRuntimes(), "Proxy handler destructor called with live runtimes?"); } bool @@ -742,7 +743,6 @@ class ScriptedIndirectProxyHandler : public BaseProxyHandler { public: ScriptedIndirectProxyHandler(); - virtual ~ScriptedIndirectProxyHandler(); /* ES5 Harmony fundamental proxy traps. */ virtual bool preventExtensions(JSContext *cx, HandleObject proxy) MOZ_OVERRIDE; @@ -804,10 +804,6 @@ ScriptedIndirectProxyHandler::ScriptedIndirectProxyHandler() { } -ScriptedIndirectProxyHandler::~ScriptedIndirectProxyHandler() -{ -} - bool ScriptedIndirectProxyHandler::isExtensible(JSContext *cx, HandleObject proxy, bool *extensible) { @@ -1060,7 +1056,6 @@ ScriptedIndirectProxyHandler ScriptedIndirectProxyHandler::singleton; class ScriptedDirectProxyHandler : public DirectProxyHandler { public: ScriptedDirectProxyHandler(); - virtual ~ScriptedDirectProxyHandler(); /* ES5 Harmony fundamental proxy traps. */ virtual bool preventExtensions(JSContext *cx, HandleObject proxy) MOZ_OVERRIDE; @@ -1659,10 +1654,6 @@ ScriptedDirectProxyHandler::ScriptedDirectProxyHandler() { } -ScriptedDirectProxyHandler::~ScriptedDirectProxyHandler() -{ -} - bool ScriptedDirectProxyHandler::preventExtensions(JSContext *cx, HandleObject proxy) { diff --git a/js/src/jsproxy.h b/js/src/jsproxy.h index 04570d9203b..037245fecc8 100644 --- a/js/src/jsproxy.h +++ b/js/src/jsproxy.h @@ -123,7 +123,7 @@ class JS_FRIEND_API(BaseProxyHandler) public: explicit BaseProxyHandler(const void *family); - virtual ~BaseProxyHandler(); + ~BaseProxyHandler(); bool hasPrototype() { return mHasPrototype; diff --git a/js/src/jswrapper.cpp b/js/src/jswrapper.cpp index fea1d54d1df..5c3a3694087 100644 --- a/js/src/jswrapper.cpp +++ b/js/src/jswrapper.cpp @@ -133,10 +133,6 @@ Wrapper::Wrapper(unsigned flags, bool hasPrototype) : DirectProxyHandler(&sWrapp setHasPrototype(hasPrototype); } -Wrapper::~Wrapper() -{ -} - Wrapper Wrapper::singleton((unsigned)0); Wrapper Wrapper::singletonWithPrototype((unsigned)0, true); JSObject *Wrapper::defaultProto = TaggedProto::LazyProto; @@ -177,10 +173,6 @@ CrossCompartmentWrapper::CrossCompartmentWrapper(unsigned flags, bool hasPrototy { } -CrossCompartmentWrapper::~CrossCompartmentWrapper() -{ -} - bool Wrapper::finalizeInBackground(Value priv) { if (!priv.isObject()) diff --git a/js/src/jswrapper.h b/js/src/jswrapper.h index ec67447f8e1..2414c68db8d 100644 --- a/js/src/jswrapper.h +++ b/js/src/jswrapper.h @@ -83,8 +83,6 @@ class JS_FRIEND_API(Wrapper) : public DirectProxyHandler explicit Wrapper(unsigned flags, bool hasPrototype = false); - virtual ~Wrapper(); - virtual bool finalizeInBackground(Value priv) MOZ_OVERRIDE; static Wrapper singleton; @@ -105,8 +103,6 @@ class JS_FRIEND_API(CrossCompartmentWrapper) : public Wrapper public: explicit CrossCompartmentWrapper(unsigned flags, bool hasPrototype = false); - virtual ~CrossCompartmentWrapper(); - /* ES5 Harmony fundamental wrapper traps. */ virtual bool preventExtensions(JSContext *cx, HandleObject wrapper) MOZ_OVERRIDE; virtual bool getPropertyDescriptor(JSContext *cx, HandleObject wrapper, HandleId id, diff --git a/js/xpconnect/wrappers/FilteringWrapper.cpp b/js/xpconnect/wrappers/FilteringWrapper.cpp index 849d7819118..4204784bd96 100644 --- a/js/xpconnect/wrappers/FilteringWrapper.cpp +++ b/js/xpconnect/wrappers/FilteringWrapper.cpp @@ -21,11 +21,6 @@ FilteringWrapper::FilteringWrapper(unsigned flags) : Base(flags) { } -template -FilteringWrapper::~FilteringWrapper() -{ -} - template static bool Filter(JSContext *cx, HandleObject wrapper, AutoIdVector &props) diff --git a/js/xpconnect/wrappers/FilteringWrapper.h b/js/xpconnect/wrappers/FilteringWrapper.h index 9ebd6fe06aa..d3d30149ed4 100644 --- a/js/xpconnect/wrappers/FilteringWrapper.h +++ b/js/xpconnect/wrappers/FilteringWrapper.h @@ -23,7 +23,6 @@ template class FilteringWrapper : public Base { public: FilteringWrapper(unsigned flags); - virtual ~FilteringWrapper(); virtual bool getPropertyDescriptor(JSContext *cx, JS::Handle wrapper, JS::Handle id, diff --git a/js/xpconnect/wrappers/WaiveXrayWrapper.cpp b/js/xpconnect/wrappers/WaiveXrayWrapper.cpp index 9c84bbc0e02..f33f6b0d540 100644 --- a/js/xpconnect/wrappers/WaiveXrayWrapper.cpp +++ b/js/xpconnect/wrappers/WaiveXrayWrapper.cpp @@ -35,10 +35,6 @@ WaiveXrayWrapper::WaiveXrayWrapper(unsigned flags) : js::CrossCompartmentWrapper { } -WaiveXrayWrapper::~WaiveXrayWrapper() -{ -} - bool WaiveXrayWrapper::getPropertyDescriptor(JSContext *cx, HandleObject wrapper, HandleId id, JS::MutableHandle desc) diff --git a/js/xpconnect/wrappers/WaiveXrayWrapper.h b/js/xpconnect/wrappers/WaiveXrayWrapper.h index 760dd0dd40e..03552233919 100644 --- a/js/xpconnect/wrappers/WaiveXrayWrapper.h +++ b/js/xpconnect/wrappers/WaiveXrayWrapper.h @@ -16,7 +16,6 @@ namespace xpc { class WaiveXrayWrapper : public js::CrossCompartmentWrapper { public: WaiveXrayWrapper(unsigned flags); - virtual ~WaiveXrayWrapper(); virtual bool getPropertyDescriptor(JSContext *cx, JS::Handle wrapper, JS::Handle id, diff --git a/js/xpconnect/wrappers/XrayWrapper.cpp b/js/xpconnect/wrappers/XrayWrapper.cpp index 829f447db28..1ea708cd09c 100644 --- a/js/xpconnect/wrappers/XrayWrapper.cpp +++ b/js/xpconnect/wrappers/XrayWrapper.cpp @@ -1619,11 +1619,6 @@ XrayWrapper::XrayWrapper(unsigned flags) Base::setHasPrototype(Traits::HasPrototype); } -template -XrayWrapper::~XrayWrapper() -{ -} - namespace XrayUtils { JSObject * diff --git a/js/xpconnect/wrappers/XrayWrapper.h b/js/xpconnect/wrappers/XrayWrapper.h index 803493bff4d..aeb79ed6442 100644 --- a/js/xpconnect/wrappers/XrayWrapper.h +++ b/js/xpconnect/wrappers/XrayWrapper.h @@ -66,7 +66,6 @@ template class XrayWrapper : public Base { public: XrayWrapper(unsigned flags); - virtual ~XrayWrapper(); /* Fundamental proxy traps. */ virtual bool isExtensible(JSContext *cx, JS::Handle wrapper, bool *extensible) MOZ_OVERRIDE;