Bug 1767829 - Part 1: Give ScriptLoaderInterface caching methods default implementations which do nothing r=yulia

Give the caching interfaces default empty implementations so derived classes
don't need to implement them if they don't want any speical behaviour. We don't
use these methods for caching in mozJSComponentLoader.

Differential Revision: https://phabricator.services.mozilla.com/D145488
This commit is contained in:
Jon Coppeard 2022-05-09 11:06:25 +00:00
Родитель b58143c665
Коммит 39651f8671
1 изменённых файлов: 5 добавлений и 3 удалений

Просмотреть файл

@ -74,12 +74,14 @@ class ScriptLoaderInterface : public nsISupports {
JS::MutableHandle<JSScript*> aIntroductionScript) = 0;
virtual void MaybePrepareModuleForBytecodeEncodingBeforeExecute(
JSContext* aCx, ModuleLoadRequest* aRequest) = 0;
JSContext* aCx, ModuleLoadRequest* aRequest) {}
virtual nsresult MaybePrepareModuleForBytecodeEncodingAfterExecute(
ModuleLoadRequest* aRequest, nsresult aRv) = 0;
ModuleLoadRequest* aRequest, nsresult aRv) {
return NS_OK;
}
virtual void MaybeTriggerBytecodeEncoding() = 0;
virtual void MaybeTriggerBytecodeEncoding() {}
};
/*