зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1539884 - Part 17: Mark nsIScriptLoaderObserver::scriptEvaluated as can_run_script r=masayuki
Depends on D134107 Differential Revision: https://phabricator.services.mozilla.com/D134108
This commit is contained in:
Родитель
6a8c77d944
Коммит
d5c873e8f4
|
@ -111,8 +111,10 @@ class ScriptLoadRequest
|
|||
GetScriptElement()->ScriptAvailable(aResult, GetScriptElement(),
|
||||
isInlineClassicScript, mURI, mLineNo);
|
||||
}
|
||||
void FireScriptEvaluated(nsresult aResult) {
|
||||
GetScriptElement()->ScriptEvaluated(aResult, GetScriptElement(), mIsInline);
|
||||
// TODO: Convert this to MOZ_CAN_RUN_SCRIPT (bug 1415230)
|
||||
MOZ_CAN_RUN_SCRIPT_BOUNDARY void FireScriptEvaluated(nsresult aResult) {
|
||||
RefPtr<nsIScriptElement> scriptElement = GetScriptElement();
|
||||
scriptElement->ScriptEvaluated(aResult, scriptElement, mIsInline);
|
||||
}
|
||||
|
||||
bool IsPreload() const {
|
||||
|
|
|
@ -2099,8 +2099,8 @@ void ScriptLoader::FireScriptEvaluated(nsresult aResult,
|
|||
ScriptLoadRequest* aRequest) {
|
||||
for (int32_t i = 0; i < mObservers.Count(); i++) {
|
||||
nsCOMPtr<nsIScriptLoaderObserver> obs = mObservers[i];
|
||||
obs->ScriptEvaluated(aResult, aRequest->GetScriptElement(),
|
||||
aRequest->mIsInline);
|
||||
RefPtr<nsIScriptElement> scriptElement = aRequest->GetScriptElement();
|
||||
obs->ScriptEvaluated(aResult, scriptElement, aRequest->mIsInline);
|
||||
}
|
||||
|
||||
aRequest->FireScriptEvaluated(aResult);
|
||||
|
|
|
@ -552,7 +552,9 @@ class ScriptLoader final : public ScriptLoaderInterface {
|
|||
nsresult ProcessRequest(ScriptLoadRequest* aRequest) override;
|
||||
nsresult CompileOffThreadOrProcessRequest(ScriptLoadRequest* aRequest);
|
||||
void FireScriptAvailable(nsresult aResult, ScriptLoadRequest* aRequest);
|
||||
void FireScriptEvaluated(nsresult aResult, ScriptLoadRequest* aRequest);
|
||||
// TODO: Convert this to MOZ_CAN_RUN_SCRIPT (bug 1415230)
|
||||
MOZ_CAN_RUN_SCRIPT_BOUNDARY void FireScriptEvaluated(
|
||||
nsresult aResult, ScriptLoadRequest* aRequest);
|
||||
|
||||
// Implements https://html.spec.whatwg.org/#execute-the-script-block
|
||||
nsresult EvaluateScriptElement(ScriptLoadRequest* aRequest);
|
||||
|
|
|
@ -41,6 +41,7 @@ interface nsIScriptLoaderObserver : nsISupports {
|
|||
* @param aElement The element being processed.
|
||||
* @param aIsInline Is this an inline script or externally loaded?
|
||||
*/
|
||||
[can_run_script]
|
||||
void scriptEvaluated(in nsresult aResult,
|
||||
in nsIScriptElement aElement,
|
||||
in boolean aIsInline);
|
||||
|
|
Загрузка…
Ссылка в новой задаче