From 448fab1f1717bda099b75053f3362307a59b30e2 Mon Sep 17 00:00:00 2001 From: Boris Zbarsky Date: Wed, 28 Mar 2018 22:46:23 -0400 Subject: [PATCH] Bug 1389581 part 2. Remove the now-unused getComponentsForScope API. r=kmag --- js/xpconnect/idl/xpccomponents.idl | 9 --------- js/xpconnect/src/XPCComponents.cpp | 17 ----------------- 2 files changed, 26 deletions(-) diff --git a/js/xpconnect/idl/xpccomponents.idl b/js/xpconnect/idl/xpccomponents.idl index fe51d10abb14..6b95dba79580 100644 --- a/js/xpconnect/idl/xpccomponents.idl +++ b/js/xpconnect/idl/xpccomponents.idl @@ -483,15 +483,6 @@ interface nsIXPCComponents_Utils : nsISupports [implicit_jscontext] void forcePermissiveCOWs(); - /* - * This seemingly-paradoxical API allows privileged code to explicitly give - * unprivileged code a reference to its own Components object (whereas it's - * normally hidden away on a scope chain visible only to XBL methods). See - * also SpecialPowers.getComponents. - */ - [implicit_jscontext] - jsval getComponentsForScope(in jsval vscope); - /* * Dispatches a runnable to the current/main thread. If |scope| is passed, * the runnable will be dispatch in the compartment of |scope|, which diff --git a/js/xpconnect/src/XPCComponents.cpp b/js/xpconnect/src/XPCComponents.cpp index 2766e6aab045..7a1d2472a7a5 100644 --- a/js/xpconnect/src/XPCComponents.cpp +++ b/js/xpconnect/src/XPCComponents.cpp @@ -2677,23 +2677,6 @@ nsXPCComponents_Utils::ForcePermissiveCOWs(JSContext* cx) return NS_OK; } -NS_IMETHODIMP -nsXPCComponents_Utils::GetComponentsForScope(HandleValue vscope, JSContext* cx, - MutableHandleValue rval) -{ - if (!vscope.isObject()) - return NS_ERROR_INVALID_ARG; - JSObject* scopeObj = js::UncheckedUnwrap(&vscope.toObject()); - XPCWrappedNativeScope* scope = ObjectScope(scopeObj); - RootedObject components(cx); - if (!scope->GetComponentsJSObject(&components)) - return NS_ERROR_FAILURE; - if (!JS_WrapObject(cx, &components)) - return NS_ERROR_FAILURE; - rval.setObject(*components); - return NS_OK; -} - NS_IMETHODIMP nsXPCComponents_Utils::Dispatch(HandleValue runnableArg, HandleValue scope, JSContext* cx)