From d893a647d46e76bbc23a8f363ea3b64a96e1eec6 Mon Sep 17 00:00:00 2001 From: Bobby Holley Date: Fri, 6 Dec 2013 12:01:42 -0800 Subject: [PATCH] Bug 937317 - Return null from ToWebIDLCallback if one doesn't already exist. r=bz --- dom/bindings/CallbackObject.h | 24 +----------------------- 1 file changed, 1 insertion(+), 23 deletions(-) diff --git a/dom/bindings/CallbackObject.h b/dom/bindings/CallbackObject.h index 0f4797ebe5f..6c8383a6d91 100644 --- a/dom/bindings/CallbackObject.h +++ b/dom/bindings/CallbackObject.h @@ -349,29 +349,7 @@ public: nsRefPtr callback = GetWebIDLCallback(); return callback.forget(); } - - XPCOMCallbackT* callback = GetXPCOMCallback(); - if (!callback) { - return nullptr; - } - - nsCOMPtr wrappedJS = do_QueryInterface(callback); - if (!wrappedJS) { - return nullptr; - } - - AutoSafeJSContext cx; - - JS::Rooted obj(cx, wrappedJS->GetJSObject()); - if (!obj) { - return nullptr; - } - - JSAutoCompartment ac(cx, obj); - - // XXXbholley - This goes away in the next patch. - nsRefPtr newCallback = new WebIDLCallbackT(obj, /* aIncumbentGlobal = */ nullptr); - return newCallback.forget(); + return nullptr; } private: