Bug 1148070 - Change nsIClassInfo::getHelperForLanguage() to getScriptableHelper(). r=bholley
authorAndrew McCreight <continuation@gmail.com>
Sun, 29 Mar 2015 07:52:54 -0700
changeset 236444 41e157bfec1d384feaf51531c810c6044b87f4d1
parent 236443 782c5106390699150a110d812eb479ff8ab044bb
child 236445 bc9e3d4db725d1996a6a18c57358a2b93843688a
push id28501
push userphilringnalda@gmail.com
push dateMon, 30 Mar 2015 00:21:22 +0000
treeherdermozilla-central@dfe60814eda7 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbholley
bugs1148070
milestone39.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1148070 - Change nsIClassInfo::getHelperForLanguage() to getScriptableHelper(). r=bholley
addon-sdk/source/lib/sdk/system/events.js
dom/base/nsDOMClassInfo.cpp
dom/base/nsHostObjectURI.cpp
dom/media/webspeech/synth/test/common.js
js/xpconnect/loader/XPCOMUtils.jsm
js/xpconnect/src/XPCComponents.cpp
js/xpconnect/src/XPCJSID.cpp
js/xpconnect/src/XPCRuntimeService.cpp
js/xpconnect/src/XPCWrappedNative.cpp
js/xpconnect/tests/unit/component-blob.js
js/xpconnect/tests/unit/component-file.js
js/xpconnect/tests/unit/component_import.js
modules/libjar/nsJARURI.cpp
netwerk/base/nsSimpleURI.cpp
netwerk/base/nsSocketTransport2.cpp
netwerk/base/nsStandardURL.cpp
security/manager/ssl/src/TransportSecurityInfo.cpp
security/manager/ssl/src/nsNSSCertificate.cpp
security/manager/ssl/src/nsNSSCertificateFakeTransport.cpp
security/manager/ssl/src/nsSSLStatus.cpp
services/common/observers.js
storage/src/mozStorageAsyncStatement.cpp
storage/src/mozStorageStatement.cpp
toolkit/modules/tests/xpcshell/test_GMPInstallManager.js
toolkit/mozapps/update/tests/data/xpcshellUtilsAUS.js
xpcom/components/nsIClassInfo.idl
xpcom/glue/nsClassInfoImpl.cpp
xpcom/glue/nsIClassInfoImpl.h
xpcom/glue/nsISupportsImpl.h
xpcom/threads/nsThread.cpp
--- a/addon-sdk/source/lib/sdk/system/events.js
+++ b/addon-sdk/source/lib/sdk/system/events.js
@@ -24,17 +24,17 @@ const Subject = Class({
     // subjects that are one of our wrappers (which we should unwrap
     // when notifying our observers) and those that are real JS XPCOM
     // components (which we should pass through unaltered).
     this.wrappedJSObject = {
       observersModuleSubjectWrapper: true,
       object: object
     };
   },
-  getHelperForLanguage: function() {},
+  getScriptableHelper: function() {},
   getInterfaces: function() {}
 });
 
 function emit(type, event) {
   // From bug 910599
   // We must test to see if 'subject' or 'data' is a defined property
   // of the event object, but also allow primitives to be passed in,
   // which the `in` operator breaks, yet `null` is an object, hence
--- a/dom/base/nsDOMClassInfo.cpp
+++ b/dom/base/nsDOMClassInfo.cpp
@@ -824,26 +824,20 @@ nsDOMClassInfo::GetInterfaces(uint32_t *
 
     *((*aArray) + i) = iid;
   }
 
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsDOMClassInfo::GetHelperForLanguage(uint32_t language, nsISupports **_retval)
+nsDOMClassInfo::GetScriptableHelper(nsIXPCScriptable **_retval)
 {
-  if (language == nsIProgrammingLanguage::JAVASCRIPT) {
-    *_retval = static_cast<nsIXPCScriptable *>(this);
-
-    NS_ADDREF(*_retval);
-  } else {
-    *_retval = nullptr;
-  }
-
+  nsCOMPtr<nsIXPCScriptable> rval = this;
+  rval.forget(_retval);
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsDOMClassInfo::GetContractID(char **aContractID)
 {
   *aContractID = nullptr;
 
--- a/dom/base/nsHostObjectURI.cpp
+++ b/dom/base/nsHostObjectURI.cpp
@@ -197,17 +197,17 @@ NS_IMETHODIMP
 nsHostObjectURI::GetInterfaces(uint32_t *count, nsIID * **array)
 {
   *count = 0;
   *array = nullptr;
   return NS_OK;
 }
 
 NS_IMETHODIMP 
-nsHostObjectURI::GetHelperForLanguage(uint32_t language, nsISupports **_retval)
+nsHostObjectURI::GetScriptableHelper(nsIXPCScriptable **_retval)
 {
   *_retval = nullptr;
   return NS_OK;
 }
 
 NS_IMETHODIMP 
 nsHostObjectURI::GetContractID(char * *aContractID)
 {
--- a/dom/media/webspeech/synth/test/common.js
+++ b/dom/media/webspeech/synth/test/common.js
@@ -11,17 +11,17 @@ function SpeechTaskCallback(onpause, onr
 
 SpeechTaskCallback.prototype = {
   QueryInterface: function(iid) {
     return this;
   },
 
   getInterfaces: function(c) {},
 
-  getHelperForLanguage: function() {},
+  getScriptableHelper: function() {},
 
   onPause: function onPause() {
     if (this.onpause)
       this.onpause();
   },
 
   onResume: function onResume() {
     if (this.onresume)
@@ -53,17 +53,17 @@ var TestSpeechServiceWithAudio = Special
   },
 
   QueryInterface: function(iid) {
     return this;
   },
 
   getInterfaces: function(c) {},
 
-  getHelperForLanguage: function() {}
+  getScriptableHelper: function() {}
 });
 
 var TestSpeechServiceNoAudio = SpecialPowers.wrapCallbackObject({
   serviceType: SpecialPowers.Ci.nsISpeechService.SERVICETYPE_INDIRECT_AUDIO,
 
   speak: function speak(aText, aUri, aRate, aPitch, aTask) {
     var pair = this.expectedSpeaks.shift();
     if (pair) {
@@ -93,17 +93,17 @@ var TestSpeechServiceNoAudio = SpecialPo
   },
 
   QueryInterface: function(iid) {
     return this;
   },
 
   getInterfaces: function(c) {},
 
-  getHelperForLanguage: function() {},
+  getScriptableHelper: function() {},
 
   expectedSpeaks: []
 });
 
 function synthAddVoice(aServiceName, aName, aLang, aIsLocal) {
   if (SpecialPowers.isMainProcess()) {
     var voicesBefore = speechSynthesis.getVoices().length;
     var uri = "urn:moz-tts:mylittleservice:" + encodeURI(aName + '?' + aLang);
--- a/js/xpconnect/loader/XPCOMUtils.jsm
+++ b/js/xpconnect/loader/XPCOMUtils.jsm
@@ -139,17 +139,17 @@ this.XPCOMUtils = {
         _interfaces.push(Ci[iface]);
       }
     }
     return {
       getInterfaces: function XPCU_getInterfaces(countRef) {
         countRef.value = _interfaces.length;
         return _interfaces;
       },
-      getHelperForLanguage: function XPCU_getHelperForLanguage(language) null,
+      getScriptableHelper: function XPCU_getScriptableHelper() null,
       contractID: classInfo.contractID,
       classDescription: classInfo.classDescription,
       classID: classInfo.classID,
       implementationLanguage: Ci.nsIProgrammingLanguage.JAVASCRIPT,
       flags: classInfo.flags,
       QueryInterface: this.generateQI([Ci.nsIClassInfo])
     };
   },
--- a/js/xpconnect/src/XPCComponents.cpp
+++ b/js/xpconnect/src/XPCComponents.cpp
@@ -148,20 +148,19 @@ nsXPCComponents_Interfaces::GetInterface
 oom:
     while (index)
         nsMemory::Free(array[--index]);
     nsMemory::Free(array);
     *aArray = nullptr;
     return NS_ERROR_OUT_OF_MEMORY;
 }
 
-/* nsISupports getHelperForLanguage (in uint32_t language); */
+/* nsIXPCScriptable getScriptableHelper(); */
 NS_IMETHODIMP
-nsXPCComponents_Interfaces::GetHelperForLanguage(uint32_t language,
-                                                 nsISupports** retval)
+nsXPCComponents_Interfaces::GetScriptableHelper(nsIXPCScriptable** retval)
 {
     *retval = nullptr;
     return NS_OK;
 }
 
 /* readonly attribute string contractID; */
 NS_IMETHODIMP
 nsXPCComponents_Interfaces::GetContractID(char * *aContractID)
@@ -392,20 +391,19 @@ nsXPCComponents_InterfacesByID::GetInter
 oom:
     while (index)
         nsMemory::Free(array[--index]);
     nsMemory::Free(array);
     *aArray = nullptr;
     return NS_ERROR_OUT_OF_MEMORY;
 }
 
-/* nsISupports getHelperForLanguage (in uint32_t language); */
+/* nsIXPCScriptable getScriptableHelper(); */
 NS_IMETHODIMP
-nsXPCComponents_InterfacesByID::GetHelperForLanguage(uint32_t language,
-                                                     nsISupports** retval)
+nsXPCComponents_InterfacesByID::GetScriptableHelper(nsIXPCScriptable** retval)
 {
     *retval = nullptr;
     return NS_OK;
 }
 
 /* readonly attribute string contractID; */
 NS_IMETHODIMP
 nsXPCComponents_InterfacesByID::GetContractID(char * *aContractID)
@@ -638,20 +636,19 @@ nsXPCComponents_Classes::GetInterfaces(u
 oom:
     while (index)
         nsMemory::Free(array[--index]);
     nsMemory::Free(array);
     *aArray = nullptr;
     return NS_ERROR_OUT_OF_MEMORY;
 }
 
-/* nsISupports getHelperForLanguage (in uint32_t language); */
+/* nsIXPCScriptable getScriptableHelper(); */
 NS_IMETHODIMP
-nsXPCComponents_Classes::GetHelperForLanguage(uint32_t language,
-                                              nsISupports** retval)
+nsXPCComponents_Classes::GetScriptableHelper(nsIXPCScriptable** retval)
 {
     *retval = nullptr;
     return NS_OK;
 }
 
 /* readonly attribute string contractID; */
 NS_IMETHODIMP
 nsXPCComponents_Classes::GetContractID(char * *aContractID)
@@ -864,20 +861,19 @@ nsXPCComponents_ClassesByID::GetInterfac
 oom:
     while (index)
         nsMemory::Free(array[--index]);
     nsMemory::Free(array);
     *aArray = nullptr;
     return NS_ERROR_OUT_OF_MEMORY;
 }
 
-/* nsISupports getHelperForLanguage (in uint32_t language); */
+/* nsIXPCScriptable getScriptableHelper(); */
 NS_IMETHODIMP
-nsXPCComponents_ClassesByID::GetHelperForLanguage(uint32_t language,
-                                                  nsISupports** retval)
+nsXPCComponents_ClassesByID::GetScriptableHelper(nsIXPCScriptable** retval)
 {
     *retval = nullptr;
     return NS_OK;
 }
 
 /* readonly attribute string contractID; */
 NS_IMETHODIMP
 nsXPCComponents_ClassesByID::GetContractID(char * *aContractID)
@@ -1113,20 +1109,19 @@ nsXPCComponents_Results::GetInterfaces(u
 oom:
     while (index)
         nsMemory::Free(array[--index]);
     nsMemory::Free(array);
     *aArray = nullptr;
     return NS_ERROR_OUT_OF_MEMORY;
 }
 
-/* nsISupports getHelperForLanguage (in uint32_t language); */
+/* nsIXPCScriptable getScriptableHelper(); */
 NS_IMETHODIMP
-nsXPCComponents_Results::GetHelperForLanguage(uint32_t language,
-                                              nsISupports** retval)
+nsXPCComponents_Results::GetScriptableHelper(nsIXPCScriptable** retval)
 {
     *retval = nullptr;
     return NS_OK;
 }
 
 /* readonly attribute string contractID; */
 NS_IMETHODIMP
 nsXPCComponents_Results::GetContractID(char * *aContractID)
@@ -1319,20 +1314,19 @@ nsXPCComponents_ID::GetInterfaces(uint32
 oom:
     while (index)
         nsMemory::Free(array[--index]);
     nsMemory::Free(array);
     *aArray = nullptr;
     return NS_ERROR_OUT_OF_MEMORY;
 }
 
-/* nsISupports getHelperForLanguage (in uint32_t language); */
+/* nsIXPCScriptable getScriptableHelper(); */
 NS_IMETHODIMP
-nsXPCComponents_ID::GetHelperForLanguage(uint32_t language,
-                                         nsISupports** retval)
+nsXPCComponents_ID::GetScriptableHelper(nsIXPCScriptable** retval)
 {
     *retval = nullptr;
     return NS_OK;
 }
 
 /* readonly attribute string contractID; */
 NS_IMETHODIMP
 nsXPCComponents_ID::GetContractID(char * *aContractID)
@@ -1536,20 +1530,19 @@ nsXPCComponents_Exception::GetInterfaces
 oom:
     while (index)
         nsMemory::Free(array[--index]);
     nsMemory::Free(array);
     *aArray = nullptr;
     return NS_ERROR_OUT_OF_MEMORY;
 }
 
-/* nsISupports getHelperForLanguage (in uint32_t language); */
+/* nsIXPCScriptable getScriptableHelper(); */
 NS_IMETHODIMP
-nsXPCComponents_Exception::GetHelperForLanguage(uint32_t language,
-                                                nsISupports** retval)
+nsXPCComponents_Exception::GetScriptableHelper(nsIXPCScriptable** retval)
 {
     *retval = nullptr;
     return NS_OK;
 }
 
 /* readonly attribute string contractID; */
 NS_IMETHODIMP
 nsXPCComponents_Exception::GetContractID(char * *aContractID)
@@ -1926,20 +1919,19 @@ nsXPCConstructor::GetInterfaces(uint32_t
 oom:
     while (index)
         nsMemory::Free(array[--index]);
     nsMemory::Free(array);
     *aArray = nullptr;
     return NS_ERROR_OUT_OF_MEMORY;
 }
 
-/* nsISupports getHelperForLanguage (in uint32_t language); */
+/* nsIXPCScriptable getScriptableHelper(); */
 NS_IMETHODIMP
-nsXPCConstructor::GetHelperForLanguage(uint32_t language,
-                                       nsISupports** retval)
+nsXPCConstructor::GetScriptableHelper(nsIXPCScriptable** retval)
 {
     *retval = nullptr;
     return NS_OK;
 }
 
 /* readonly attribute string contractID; */
 NS_IMETHODIMP
 nsXPCConstructor::GetContractID(char * *aContractID)
@@ -2181,20 +2173,19 @@ nsXPCComponents_Constructor::GetInterfac
 oom:
     while (index)
         nsMemory::Free(array[--index]);
     nsMemory::Free(array);
     *aArray = nullptr;
     return NS_ERROR_OUT_OF_MEMORY;
 }
 
-/* nsISupports getHelperForLanguage (in uint32_t language); */
+/* nsIXPCScriptable getScriptableHelper(); */
 NS_IMETHODIMP
-nsXPCComponents_Constructor::GetHelperForLanguage(uint32_t language,
-                                                  nsISupports** retval)
+nsXPCComponents_Constructor::GetScriptableHelper(nsIXPCScriptable** retval)
 {
     *retval = nullptr;
     return NS_OK;
 }
 
 /* readonly attribute string contractID; */
 NS_IMETHODIMP
 nsXPCComponents_Constructor::GetContractID(char * *aContractID)
@@ -3730,17 +3721,17 @@ public:
     {
     }
 
     NS_DECL_ISUPPORTS
     NS_DECL_NSIXPCSCRIPTABLE
     // The NS_IMETHODIMP isn't really accurate here, but NS_CALLBACK requires
     // the referent to be declared __stdcall on Windows, and this is the only
     // macro that does that.
-    static NS_IMETHODIMP Get(uint32_t aLangId, nsISupports** helper)
+    static NS_IMETHODIMP Get(nsIXPCScriptable** helper)
     {
         *helper = &singleton;
         return NS_OK;
     }
 
 private:
     static ComponentsSH singleton;
 };
--- a/js/xpconnect/src/XPCJSID.cpp
+++ b/js/xpconnect/src/XPCJSID.cpp
@@ -234,25 +234,21 @@ static void EnsureClassObjectsInitialize
 {
     if (!gClassObjectsWereInited) {
         gSharedScriptableHelperForJSIID = new SharedScriptableHelperForJSIID();
 
         gClassObjectsWereInited = true;
     }
 }
 
-NS_METHOD GetSharedScriptableHelperForJSIID(uint32_t language,
-                                            nsISupports** helper)
+NS_METHOD GetSharedScriptableHelperForJSIID(nsIXPCScriptable** helper)
 {
     EnsureClassObjectsInitialized();
-    if (language == nsIProgrammingLanguage::JAVASCRIPT) {
-        nsCOMPtr<nsIXPCScriptable> temp = gSharedScriptableHelperForJSIID.get();
-        temp.forget(helper);
-    } else
-        *helper = nullptr;
+    nsCOMPtr<nsIXPCScriptable> temp = gSharedScriptableHelperForJSIID.get();
+    temp.forget(helper);
     return NS_OK;
 }
 
 /******************************************************/
 
 #define NULL_CID                                                              \
 { 0x00000000, 0x0000, 0x0000,                                                 \
   { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 } }
--- a/js/xpconnect/src/XPCRuntimeService.cpp
+++ b/js/xpconnect/src/XPCRuntimeService.cpp
@@ -109,24 +109,22 @@ BackstagePass::GetInterfaces(uint32_t* a
 oom:
     while (index)
         nsMemory::Free(array[--index]);
     nsMemory::Free(array);
     *aArray = nullptr;
     return NS_ERROR_OUT_OF_MEMORY;
 }
 
-/* nsISupports getHelperForLanguage (in uint32_t language); */
+/* nsIXPCScriptable getScriptableHelper (); */
 NS_IMETHODIMP
-BackstagePass::GetHelperForLanguage(uint32_t language,
-                                    nsISupports** retval)
+BackstagePass::GetScriptableHelper(nsIXPCScriptable** retval)
 {
-    nsCOMPtr<nsISupports> supports =
-        do_QueryInterface(static_cast<nsIGlobalObject*>(this));
-    supports.forget(retval);
+    nsCOMPtr<nsIXPCScriptable> scriptable = this;
+    scriptable.forget(retval);
     return NS_OK;
 }
 
 /* readonly attribute string contractID; */
 NS_IMETHODIMP
 BackstagePass::GetContractID(char * *aContractID)
 {
     *aContractID = nullptr;
--- a/js/xpconnect/src/XPCWrappedNative.cpp
+++ b/js/xpconnect/src/XPCWrappedNative.cpp
@@ -650,26 +650,22 @@ XPCWrappedNative::GatherProtoScriptableC
           dont_AddRef(static_cast<nsIXPCScriptable*>(classInfoHelper));
         uint32_t flags = classInfoHelper->GetScriptableFlags();
         sciProto.SetCallback(helper.forget());
         sciProto.SetFlags(XPCNativeScriptableFlags(flags));
 
         return;
     }
 
-    nsCOMPtr<nsISupports> possibleHelper;
-    nsresult rv = classInfo->GetHelperForLanguage(nsIProgrammingLanguage::JAVASCRIPT,
-                                                  getter_AddRefs(possibleHelper));
-    if (NS_SUCCEEDED(rv) && possibleHelper) {
-        nsCOMPtr<nsIXPCScriptable> helper(do_QueryInterface(possibleHelper));
-        if (helper) {
-            uint32_t flags = helper->GetScriptableFlags();
-            sciProto.SetCallback(helper.forget());
-            sciProto.SetFlags(XPCNativeScriptableFlags(flags));
-        }
+    nsCOMPtr<nsIXPCScriptable> helper;
+    nsresult rv = classInfo->GetScriptableHelper(getter_AddRefs(helper));
+    if (NS_SUCCEEDED(rv) && helper) {
+        uint32_t flags = helper->GetScriptableFlags();
+        sciProto.SetCallback(helper.forget());
+        sciProto.SetFlags(XPCNativeScriptableFlags(flags));
     }
 }
 
 // static
 const XPCNativeScriptableCreateInfo&
 XPCWrappedNative::GatherScriptableCreateInfo(nsISupports* obj,
                                              nsIClassInfo* classInfo,
                                              XPCNativeScriptableCreateInfo& sciProto,
--- a/js/xpconnect/tests/unit/component-blob.js
+++ b/js/xpconnect/tests/unit/component-blob.js
@@ -63,17 +63,17 @@ BlobComponent.prototype =
   flags: 0,
 
   getInterfaces: function getInterfaces(aCount) {
     var interfaces = [Components.interfaces.nsIClassInfo];
     aCount.value = interfaces.length;
     return interfaces;
   },
 
-  getHelperForLanguage: function getHelperForLanguage(aLanguage) {
+  getScriptableHelper: function getScriptableHelper() {
     return null;
   },
 
   // nsISupports
   QueryInterface: XPCOMUtils.generateQI([Components.interfaces.nsIClassInfo])
 };
 
 var gComponentsArray = [BlobComponent];
--- a/js/xpconnect/tests/unit/component-file.js
+++ b/js/xpconnect/tests/unit/component-file.js
@@ -88,17 +88,17 @@ FileComponent.prototype =
   flags: 0,
 
   getInterfaces: function getInterfaces(aCount) {
     var interfaces = [Components.interfaces.nsIClassInfo];
     aCount.value = interfaces.length;
     return interfaces;
   },
 
-  getHelperForLanguage: function getHelperForLanguage(aLanguage) {
+  getScriptableHelper: function getScriptableHelper() {
     return null;
   },
 
   // nsISupports
   QueryInterface: XPCOMUtils.generateQI([Components.interfaces.nsIClassInfo])
 };
 
 var gComponentsArray = [FileComponent];
--- a/js/xpconnect/tests/unit/component_import.js
+++ b/js/xpconnect/tests/unit/component_import.js
@@ -30,17 +30,17 @@ FooComponent.prototype =
     } catch (ex) {
       do_check_true(ex.lineNumber == 28);
     }
     do_check_true(threw);
     
     return interfaces;
   },
 
-  getHelperForLanguage: function getHelperForLanguage(aLanguage) {
+  getScriptableHelper: function getScriptableHelper() {
     return null;
   },
 
   // nsISupports
   QueryInterface: function QueryInterface(aIID) {
     if (aIID.equals(Components.interfaces.nsIClassInfo) ||
         aIID.equals(Components.interfaces.nsISupports))
       return this;
@@ -63,17 +63,17 @@ BarComponent.prototype =
   flags: 0,
 
   getInterfaces: function getInterfaces(aCount) {
     var interfaces = [Components.interfaces.nsIClassInfo];
     aCount.value = interfaces.length;
     return interfaces;
   },
 
-  getHelperForLanguage: function getHelperForLanguage(aLanguage) {
+  getScriptableHelper: function getScriptableHelper() {
     return null;
   },
 
   // nsISupports
   QueryInterface: XPCOMUtils.generateQI([Components.interfaces.nsIClassInfo])
 };
 
 function do_check_true(cond, text) {
--- a/modules/libjar/nsJARURI.cpp
+++ b/modules/libjar/nsJARURI.cpp
@@ -161,17 +161,17 @@ NS_IMETHODIMP
 nsJARURI::GetInterfaces(uint32_t *count, nsIID * **array)
 {
     *count = 0;
     *array = nullptr;
     return NS_OK;
 }
 
 NS_IMETHODIMP 
-nsJARURI::GetHelperForLanguage(uint32_t language, nsISupports **_retval)
+nsJARURI::GetScriptableHelper(nsIXPCScriptable **_retval)
 {
     *_retval = nullptr;
     return NS_OK;
 }
 
 NS_IMETHODIMP 
 nsJARURI::GetContractID(char * *aContractID)
 {
--- a/netwerk/base/nsSimpleURI.cpp
+++ b/netwerk/base/nsSimpleURI.cpp
@@ -552,17 +552,17 @@ NS_IMETHODIMP
 nsSimpleURI::GetInterfaces(uint32_t *count, nsIID * **array)
 {
     *count = 0;
     *array = nullptr;
     return NS_OK;
 }
 
 NS_IMETHODIMP 
-nsSimpleURI::GetHelperForLanguage(uint32_t language, nsISupports **_retval)
+nsSimpleURI::GetScriptableHelper(nsIXPCScriptable **_retval)
 {
     *_retval = nullptr;
     return NS_OK;
 }
 
 NS_IMETHODIMP 
 nsSimpleURI::GetContractID(char * *aContractID)
 {
--- a/netwerk/base/nsSocketTransport2.cpp
+++ b/netwerk/base/nsSocketTransport2.cpp
@@ -2434,17 +2434,17 @@ nsSocketTransport::GetInterface(const ns
 
 NS_IMETHODIMP
 nsSocketTransport::GetInterfaces(uint32_t *count, nsIID * **array)
 {
     return NS_CI_INTERFACE_GETTER_NAME(nsSocketTransport)(count, array);
 }
 
 NS_IMETHODIMP
-nsSocketTransport::GetHelperForLanguage(uint32_t language, nsISupports **_retval)
+nsSocketTransport::GetScriptableHelper(nsIXPCScriptable **_retval)
 {
     *_retval = nullptr;
     return NS_OK;
 }
 
 NS_IMETHODIMP
 nsSocketTransport::GetContractID(char * *aContractID)
 {
--- a/netwerk/base/nsStandardURL.cpp
+++ b/netwerk/base/nsStandardURL.cpp
@@ -3174,17 +3174,17 @@ NS_IMETHODIMP
 nsStandardURL::GetInterfaces(uint32_t *count, nsIID * **array)
 {
     *count = 0;
     *array = nullptr;
     return NS_OK;
 }
 
 NS_IMETHODIMP 
-nsStandardURL::GetHelperForLanguage(uint32_t language, nsISupports **_retval)
+nsStandardURL::GetScriptableHelper(nsIXPCScriptable **_retval)
 {
     *_retval = nullptr;
     return NS_OK;
 }
 
 NS_IMETHODIMP 
 nsStandardURL::GetContractID(char * *aContractID)
 {
--- a/security/manager/ssl/src/TransportSecurityInfo.cpp
+++ b/security/manager/ssl/src/TransportSecurityInfo.cpp
@@ -442,18 +442,17 @@ NS_IMETHODIMP
 TransportSecurityInfo::GetInterfaces(uint32_t *count, nsIID * **array)
 {
   *count = 0;
   *array = nullptr;
   return NS_OK;
 }
 
 NS_IMETHODIMP
-TransportSecurityInfo::GetHelperForLanguage(uint32_t language,
-                                            nsISupports **_retval)
+TransportSecurityInfo::GetScriptableHelper(nsIXPCScriptable **_retval)
 {
   *_retval = nullptr;
   return NS_OK;
 }
 
 NS_IMETHODIMP
 TransportSecurityInfo::GetContractID(char * *aContractID)
 {
--- a/security/manager/ssl/src/nsNSSCertificate.cpp
+++ b/security/manager/ssl/src/nsNSSCertificate.cpp
@@ -1916,18 +1916,17 @@ NS_IMETHODIMP
 nsNSSCertificate::GetInterfaces(uint32_t* count, nsIID*** array)
 {
   *count = 0;
   *array = nullptr;
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsNSSCertificate::GetHelperForLanguage(uint32_t language,
-                                       nsISupports** _retval)
+nsNSSCertificate::GetScriptableHelper(nsIXPCScriptable** _retval)
 {
   *_retval = nullptr;
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsNSSCertificate::GetContractID(char** aContractID)
 {
--- a/security/manager/ssl/src/nsNSSCertificateFakeTransport.cpp
+++ b/security/manager/ssl/src/nsNSSCertificateFakeTransport.cpp
@@ -285,18 +285,17 @@ NS_IMETHODIMP
 nsNSSCertificateFakeTransport::GetInterfaces(uint32_t* count, nsIID*** array)
 {
   *count = 0;
   *array = nullptr;
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsNSSCertificateFakeTransport::GetHelperForLanguage(uint32_t,
-                                                    nsISupports** _retval)
+nsNSSCertificateFakeTransport::GetScriptableHelper(nsIXPCScriptable** _retval)
 {
   *_retval = nullptr;
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsNSSCertificateFakeTransport::GetContractID(char** aContractID)
 {
--- a/security/manager/ssl/src/nsSSLStatus.cpp
+++ b/security/manager/ssl/src/nsSSLStatus.cpp
@@ -209,17 +209,17 @@ NS_IMETHODIMP
 nsSSLStatus::GetInterfaces(uint32_t* aCount, nsIID*** aArray)
 {
   *aCount = 0;
   *aArray = nullptr;
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsSSLStatus::GetHelperForLanguage(uint32_t aLanguage, nsISupports** aHelper)
+nsSSLStatus::GetScriptableHelper(nsIXPCScriptable** aHelper)
 {
   *aHelper = nullptr;
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsSSLStatus::GetContractID(char** aContractID)
 {
--- a/services/common/observers.js
+++ b/services/common/observers.js
@@ -144,11 +144,11 @@ function Subject(object) {
   // as one of our wrappers to distinguish between subjects that are one of our
   // wrappers (which we should unwrap when notifying our observers) and those
   // that are real JS XPCOM components (which we should pass through unaltered).
   this.wrappedJSObject = { observersModuleSubjectWrapper: true, object: object };
 }
 
 Subject.prototype = {
   QueryInterface: XPCOMUtils.generateQI([]),
-  getHelperForLanguage: function() {},
+  getScriptableHelper: function() {},
   getInterfaces: function() {}
 };
--- a/storage/src/mozStorageAsyncStatement.cpp
+++ b/storage/src/mozStorageAsyncStatement.cpp
@@ -53,25 +53,20 @@ public:
 
   NS_IMETHODIMP
   GetInterfaces(uint32_t *_count, nsIID ***_array) override
   {
     return NS_CI_INTERFACE_GETTER_NAME(AsyncStatement)(_count, _array);
   }
 
   NS_IMETHODIMP
-  GetHelperForLanguage(uint32_t aLanguage, nsISupports **_helper) override
+  GetScriptableHelper(nsIXPCScriptable **_helper) override
   {
-    if (aLanguage == nsIProgrammingLanguage::JAVASCRIPT) {
-      static AsyncStatementJSHelper sJSHelper;
-      *_helper = &sJSHelper;
-      return NS_OK;
-    }
-
-    *_helper = nullptr;
+    static AsyncStatementJSHelper sJSHelper;
+    *_helper = &sJSHelper;
     return NS_OK;
   }
 
   NS_IMETHODIMP
   GetContractID(char **_contractID) override
   {
     *_contractID = nullptr;
     return NS_OK;
--- a/storage/src/mozStorageStatement.cpp
+++ b/storage/src/mozStorageStatement.cpp
@@ -55,25 +55,20 @@ public:
 
   NS_IMETHODIMP
   GetInterfaces(uint32_t *_count, nsIID ***_array) override
   {
     return NS_CI_INTERFACE_GETTER_NAME(Statement)(_count, _array);
   }
 
   NS_IMETHODIMP
-  GetHelperForLanguage(uint32_t aLanguage, nsISupports **_helper) override
+  GetScriptableHelper(nsIXPCScriptable **_helper) override
   {
-    if (aLanguage == nsIProgrammingLanguage::JAVASCRIPT) {
-      static StatementJSHelper sJSHelper;
-      *_helper = &sJSHelper;
-      return NS_OK;
-    }
-
-    *_helper = nullptr;
+    static StatementJSHelper sJSHelper;
+    *_helper = &sJSHelper;
     return NS_OK;
   }
 
   NS_IMETHODIMP
   GetContractID(char **_contractID) override
   {
     *_contractID = nullptr;
     return NS_OK;
--- a/toolkit/modules/tests/xpcshell/test_GMPInstallManager.js
+++ b/toolkit/modules/tests/xpcshell/test_GMPInstallManager.js
@@ -749,17 +749,17 @@ xhr.prototype = {
       }
     }
   },
   addEventListener: function(aEvent, aValue, aCapturing) {
     eval("this._on" + aEvent + " = aValue");
   },
   flags: Ci.nsIClassInfo.SINGLETON,
   implementationLanguage: Ci.nsIProgrammingLanguage.JAVASCRIPT,
-  getHelperForLanguage: function(aLanguage) null,
+  getScriptableHelper: function() null,
   getInterfaces: function(aCount) {
     let interfaces = [Ci.nsISupports];
     aCount.value = interfaces.length;
     return interfaces;
   },
   classDescription: "XMLHttpRequest",
   contractID: "@mozilla.org/xmlextras/xmlhttprequest;1",
   classID: Components.ID("{c9b37f43-4278-4304-a5e0-600991ab08cb}"),
--- a/toolkit/mozapps/update/tests/data/xpcshellUtilsAUS.js
+++ b/toolkit/mozapps/update/tests/data/xpcshellUtilsAUS.js
@@ -3039,17 +3039,17 @@ xhr.prototype = {
   _onload: null,
   set onload(aValue) { gXHR._onload = makeHandler(aValue); },
   get onload() { return gXHR._onload; },
   addEventListener: function(aEvent, aValue, aCapturing) {
     eval("gXHR._on" + aEvent + " = aValue");
   },
   flags: Ci.nsIClassInfo.SINGLETON,
   implementationLanguage: Ci.nsIProgrammingLanguage.JAVASCRIPT,
-  getHelperForLanguage: function(aLanguage) null,
+  getScriptableHelper: function() null,
   getInterfaces: function(aCount) {
     let interfaces = [Ci.nsISupports];
     aCount.value = interfaces.length;
     return interfaces;
   },
   classDescription: "XMLHttpRequest",
   contractID: "@mozilla.org/xmlextras/xmlhttprequest;1",
   classID: Components.ID("{c9b37f43-4278-4304-a5e0-600991ab08cb}"),
@@ -3097,17 +3097,17 @@ function UpdatePrompt() {
                      Array.prototype.slice.call(arguments));
     }
   });
 }
 
 UpdatePrompt.prototype = {
   flags: Ci.nsIClassInfo.SINGLETON,
   implementationLanguage: Ci.nsIProgrammingLanguage.JAVASCRIPT,
-  getHelperForLanguage: function(aLanguage) null,
+  getScriptableHelper: function() null,
   getInterfaces: function(aCount) {
     let interfaces = [Ci.nsISupports, Ci.nsIUpdatePrompt];
     aCount.value = interfaces.length;
     return interfaces;
   },
   classDescription: "UpdatePrompt",
   contractID: "@mozilla.org/updates/update-prompt;1",
   classID: Components.ID("{8c350a15-9b90-4622-93a1-4d320308664b}"),
--- a/xpcom/components/nsIClassInfo.idl
+++ b/xpcom/components/nsIClassInfo.idl
@@ -1,49 +1,43 @@
 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
  *
  * This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "nsISupports.idl"
 
+interface nsIXPCScriptable;
+
 /**
  * Provides information about a specific implementation class.  If you want
  * your class to implement nsIClassInfo, see nsIClassInfoImpl.h for
  * instructions--you most likely do not want to inherit from nsIClassInfo.
  */
 
-[scriptable, uuid(986c11d0-f340-11d4-9075-0010a4e73d9a)]
+[scriptable, uuid(7a633335-18cc-4794-9ddd-26ac7cab7be6)]
 interface nsIClassInfo : nsISupports
 {
     /**
      * Get an ordered list of the interface ids that instances of the class 
      * promise to implement. Note that nsISupports is an implicit member 
      * of any such list and need not be included. 
      *
      * Should set *count = 0 and *array = null and return NS_OK if getting the 
      * list is not supported.
      */
     void getInterfaces(out uint32_t count, 
                        [array, size_is(count), retval] out nsIIDPtr array);
 
     /**
-     * Get a language mapping specific helper object that may assist in using
-     * objects of this class in a specific lanaguage. For instance, if asked
-     * for the helper for nsIProgrammingLanguage::JAVASCRIPT this might return 
-     * an object that can be QI'd into the nsIXPCScriptable interface to assist 
-     * XPConnect in supplying JavaScript specific behavior to callers of the 
-     * instance object.
-     *
-     * see: nsIProgrammingLanguage.idl
-     *
-     * Should return null if no helper available for given language.
+     * Return an object to assist XPConnect in supplying JavaScript-specific
+     * behavior to callers of the instance object, or null if not needed.
      */
-    nsISupports getHelperForLanguage(in uint32_t language);
+    nsIXPCScriptable getScriptableHelper();
 
     /**
      * A contract ID through which an instance of this class can be created
      * (or accessed as a service, if |flags & SINGLETON|), or null.
      */
     readonly attribute string   contractID;
 
     /**
--- a/xpcom/glue/nsClassInfoImpl.cpp
+++ b/xpcom/glue/nsClassInfoImpl.cpp
@@ -23,21 +23,20 @@ NS_IMPL_QUERY_INTERFACE(GenericClassInfo
 
 NS_IMETHODIMP
 GenericClassInfo::GetInterfaces(uint32_t* aCount, nsIID*** aArray)
 {
   return mData->getinterfaces(aCount, aArray);
 }
 
 NS_IMETHODIMP
-GenericClassInfo::GetHelperForLanguage(uint32_t aLanguage,
-                                       nsISupports** aHelper)
+GenericClassInfo::GetScriptableHelper(nsIXPCScriptable** aHelper)
 {
-  if (mData->getlanguagehelper) {
-    return mData->getlanguagehelper(aLanguage, aHelper);
+  if (mData->getscriptablehelper) {
+    return mData->getscriptablehelper(aHelper);
   }
   return NS_ERROR_NOT_IMPLEMENTED;
 }
 
 NS_IMETHODIMP
 GenericClassInfo::GetContractID(char** aContractID)
 {
   NS_ERROR("GetContractID not implemented");
--- a/xpcom/glue/nsIClassInfoImpl.h
+++ b/xpcom/glue/nsIClassInfoImpl.h
@@ -86,21 +86,20 @@
 
 class GenericClassInfo : public nsIClassInfo
 {
 public:
   struct ClassInfoData
   {
     typedef NS_CALLBACK(GetInterfacesProc)(uint32_t* aCountP,
                                            nsIID*** aArray);
-    typedef NS_CALLBACK(GetLanguageHelperProc)(uint32_t aLanguage,
-                                               nsISupports** aHelper);
+    typedef NS_CALLBACK(GetScriptableHelperProc)(nsIXPCScriptable** aHelper);
 
     GetInterfacesProc getinterfaces;
-    GetLanguageHelperProc getlanguagehelper;
+    GetScriptableHelperProc getscriptablehelper;
     uint32_t flags;
     nsCID cid;
   };
 
   NS_DECL_ISUPPORTS_INHERITED
   NS_DECL_NSICLASSINFO
 
   explicit GenericClassInfo(const ClassInfoData* aData) : mData(aData) {}
@@ -110,21 +109,21 @@ private:
 };
 
 #define NS_CLASSINFO_NAME(_class) g##_class##_classInfoGlobal
 #define NS_CI_INTERFACE_GETTER_NAME(_class) _class##_GetInterfacesHelper
 #define NS_DECL_CI_INTERFACE_GETTER(_class)                                   \
   extern NS_IMETHODIMP NS_CI_INTERFACE_GETTER_NAME(_class)                    \
      (uint32_t *, nsIID ***);
 
-#define NS_IMPL_CLASSINFO(_class, _getlanguagehelper, _flags, _cid)     \
+#define NS_IMPL_CLASSINFO(_class, _getscriptablehelper, _flags, _cid)   \
   NS_DECL_CI_INTERFACE_GETTER(_class)                                   \
   static const GenericClassInfo::ClassInfoData k##_class##ClassInfoData = { \
     NS_CI_INTERFACE_GETTER_NAME(_class),                                \
-    _getlanguagehelper,                                                 \
+    _getscriptablehelper,                                               \
     _flags | nsIClassInfo::SINGLETON_CLASSINFO,                         \
     _cid,                                                               \
   };                                                                    \
   mozilla::AlignedStorage2<GenericClassInfo> k##_class##ClassInfoDataPlace;   \
   nsIClassInfo* NS_CLASSINFO_NAME(_class) = nullptr;
 
 #define NS_IMPL_QUERY_CLASSINFO(_class)                                       \
   if ( aIID.Equals(NS_GET_IID(nsIClassInfo)) ) {                              \
--- a/xpcom/glue/nsISupportsImpl.h
+++ b/xpcom/glue/nsISupportsImpl.h
@@ -1076,17 +1076,17 @@ NS_IMETHODIMP_(MozExternalRefCountType) 
 #define NS_IMPL_THREADSAFE_CI(_class)                                         \
 NS_IMETHODIMP                                                                 \
 _class::GetInterfaces(uint32_t* _count, nsIID*** _array)                      \
 {                                                                             \
   return NS_CI_INTERFACE_GETTER_NAME(_class)(_count, _array);                 \
 }                                                                             \
                                                                               \
 NS_IMETHODIMP                                                                 \
-_class::GetHelperForLanguage(uint32_t _language, nsISupports** _retval)       \
+_class::GetScriptableHelper(nsIXPCScriptable** _retval)                       \
 {                                                                             \
   *_retval = nullptr;                                                         \
   return NS_OK;                                                               \
 }                                                                             \
                                                                               \
 NS_IMETHODIMP                                                                 \
 _class::GetContractID(char** _contractID)                                     \
 {                                                                             \
--- a/xpcom/threads/nsThread.cpp
+++ b/xpcom/threads/nsThread.cpp
@@ -121,17 +121,17 @@ NS_IMPL_QUERY_INTERFACE(nsThreadClassInf
 
 NS_IMETHODIMP
 nsThreadClassInfo::GetInterfaces(uint32_t* aCount, nsIID*** aArray)
 {
   return NS_CI_INTERFACE_GETTER_NAME(nsThread)(aCount, aArray);
 }
 
 NS_IMETHODIMP
-nsThreadClassInfo::GetHelperForLanguage(uint32_t aLang, nsISupports** aResult)
+nsThreadClassInfo::GetScriptableHelper(nsIXPCScriptable** aResult)
 {
   *aResult = nullptr;
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsThreadClassInfo::GetContractID(char** aResult)
 {