Bug 1656307 - Clean up some do_ImportModule calls with new overload, r=kmag

Differential Revision: https://phabricator.services.mozilla.com/D85449
This commit is contained in:
Nika Layzell 2020-08-04 21:39:52 +00:00
parent 94ef7ca811
commit f60ca8ca4d
4 changed files with 5 additions and 22 deletions

View File

@ -84,11 +84,8 @@ bool Localization::Init() {
}
void Localization::Activate(const bool aEager) {
nsCOMPtr<mozILocalizationJSM> jsm =
do_ImportModule("resource://gre/modules/Localization.jsm");
MOZ_RELEASE_ASSERT(jsm);
Unused << jsm->GetLocalization(getter_AddRefs(mLocalization));
mLocalization = do_ImportModule("resource://gre/modules/Localization.jsm",
"Localization");
MOZ_RELEASE_ASSERT(mLocalization);
AutoJSContext cx;

View File

@ -39,9 +39,3 @@ interface mozILocalization : nsISupports
Array<AUTF8String> formatValuesSync(in Array<AString> aResourceIds, in jsval aBundles, in Array<jsval> aKeys);
Array<jsval> formatMessagesSync(in Array<AString> aResourceIds, in jsval aBundles, in Array<jsval> aKeys);
};
[scriptable, uuid(96632d26-1422-12e9-b1ce-9bb586acd241)]
interface mozILocalizationJSM : nsISupports
{
readonly attribute mozILocalization Localization;
};

View File

@ -66,11 +66,9 @@ static mozIExtensionProcessScript& ProcessScript() {
static nsCOMPtr<mozIExtensionProcessScript> sProcessScript;
if (MOZ_UNLIKELY(!sProcessScript)) {
nsCOMPtr<mozIExtensionProcessScriptJSM> jsm =
do_ImportModule("resource://gre/modules/ExtensionProcessScript.jsm");
MOZ_RELEASE_ASSERT(jsm);
Unused << jsm->GetExtensionProcessScript(getter_AddRefs(sProcessScript));
sProcessScript =
do_ImportModule("resource://gre/modules/ExtensionProcessScript.jsm",
"ExtensionProcessScript");
MOZ_RELEASE_ASSERT(sProcessScript);
ClearOnShutdown(&sProcessScript);
}

View File

@ -19,9 +19,3 @@ interface mozIExtensionProcessScript : nsISupports
void initExtensionDocument(in nsISupports extension, in Document doc,
in bool privileged);
};
[scriptable, uuid(9f2a6434-f0ef-4063-ae33-368d929805d2)]
interface mozIExtensionProcessScriptJSM : nsISupports
{
readonly attribute mozIExtensionProcessScript ExtensionProcessScript;
};