From ae8b4cf576c5a466835775d20a11b90bc42098b7 Mon Sep 17 00:00:00 2001 From: Boris Zbarsky Date: Thu, 21 Nov 2013 07:51:15 -0500 Subject: [PATCH] Bug 941437 part 1. Remove the unused cx argument from dom::UnwrapObject. r=smaug --- dom/bindings/BindingUtils.cpp | 4 ++-- dom/bindings/BindingUtils.h | 4 ++-- dom/bindings/Codegen.py | 2 +- dom/workers/WorkerScope.cpp | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/dom/bindings/BindingUtils.cpp b/dom/bindings/BindingUtils.cpp index cd688c7bedbe..668f0420d69b 100644 --- a/dom/bindings/BindingUtils.cpp +++ b/dom/bindings/BindingUtils.cpp @@ -1793,10 +1793,10 @@ ReparentWrapper(JSContext* aCx, JS::Handle aObjArg) nsresult rv = UNWRAP_OBJECT(HTMLObjectElement, aCx, aObj, htmlobject); if (NS_FAILED(rv)) { rv = UnwrapObject(aCx, aObj, htmlobject); + HTMLSharedObjectElement>(aObj, htmlobject); if (NS_FAILED(rv)) { rv = UnwrapObject(aCx, aObj, htmlobject); + HTMLSharedObjectElement>(aObj, htmlobject); if (NS_FAILED(rv)) { htmlobject = nullptr; } diff --git a/dom/bindings/BindingUtils.h b/dom/bindings/BindingUtils.h index c37b5efba879..96c600847370 100644 --- a/dom/bindings/BindingUtils.h +++ b/dom/bindings/BindingUtils.h @@ -195,7 +195,7 @@ IsDOMObject(JSObject* obj) #define UNWRAP_OBJECT(Interface, cx, obj, value) \ mozilla::dom::UnwrapObject(cx, obj, value) + mozilla::dom::Interface##Binding::NativeType>(obj, value) // Some callers don't want to set an exception when unwrapping fails // (for example, overload resolution uses unwrapping to tell what sort @@ -203,7 +203,7 @@ IsDOMObject(JSObject* obj) // U must be something that a T* can be assigned to (e.g. T* or an nsRefPtr). template MOZ_ALWAYS_INLINE nsresult -UnwrapObject(JSContext* cx, JSObject* obj, U& value) +UnwrapObject(JSObject* obj, U& value) { /* First check to see whether we have a DOM object */ const DOMClass* domClass = GetDOMClass(obj); diff --git a/dom/bindings/Codegen.py b/dom/bindings/Codegen.py index 657e5d5645db..dd7383d5a749 100644 --- a/dom/bindings/Codegen.py +++ b/dom/bindings/Codegen.py @@ -2536,7 +2536,7 @@ class CastableObjectUnwrapper(): codeOnFailure = self.substitution["codeOnFailure"] % {'securityError': 'rv == NS_ERROR_XPC_SECURITY_MANAGER_VETO'} return string.Template( """{ - nsresult rv = UnwrapObject<${protoID}, ${type}>(cx, ${source}, ${target}); + nsresult rv = UnwrapObject<${protoID}, ${type}>(${source}, ${target}); if (NS_FAILED(rv)) { ${codeOnFailure} } diff --git a/dom/workers/WorkerScope.cpp b/dom/workers/WorkerScope.cpp index 9a7f9f2d5c2a..c1d5aed50029 100644 --- a/dom/workers/WorkerScope.cpp +++ b/dom/workers/WorkerScope.cpp @@ -24,7 +24,7 @@ #define UNWRAP_WORKER_OBJECT(Interface, cx, obj, value) \ UnwrapObject(cx, obj, value) + mozilla::dom::Interface##Binding_workers::NativeType>(obj, value) using namespace mozilla::dom; USING_WORKERS_NAMESPACE