/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ /* vim: set ts=8 sts=2 et sw=2 tw=80: */ /* 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/. */
switch (mKind) { case ScriptKind::eClassic: case ScriptKind::eImportMap:
MOZ_ASSERT(mLoadedScript->IsClassicScript()); break; case ScriptKind::eModule:
MOZ_ASSERT(mLoadedScript->IsModuleScript()); break; case ScriptKind::eEvent:
MOZ_ASSERT_UNREACHABLE("EventScripts are not using ScriptLoadRequest"); break;
}
mState = State::Ready;
}
void ScriptLoadRequest::NoCacheEntryFound() {
MOZ_ASSERT(IsCheckingCache());
MOZ_ASSERT(mURI); // At the time where we check in the cache, the mBaseURL is not set, as this // is resolved by the network. Thus we use the mURI, for checking the cache // and later replace the mBaseURL using what the Channel->GetURI will provide. switch (mKind) { case ScriptKind::eClassic: case ScriptKind::eImportMap:
mLoadedScript = new ClassicScript(mReferrerPolicy, mFetchOptions, mURI); break; case ScriptKind::eModule:
mLoadedScript = new ModuleScript(mReferrerPolicy, mFetchOptions, mURI); break; case ScriptKind::eEvent:
MOZ_ASSERT_UNREACHABLE("EventScripts are not using ScriptLoadRequest"); break;
}
mState = State::Fetching;
}
void ScriptLoadRequest::SetBaseURLFromChannelAndOriginalURI(
nsIChannel* aChannel, nsIURI* aOriginalURI) { // Fixup moz-extension: and resource: URIs, because the channel URI will // point to file:, which won't be allowed to load. if (aOriginalURI && IsInternalURIScheme(aOriginalURI)) {
mBaseURL = aOriginalURI;
} else {
aChannel->GetURI(getter_AddRefs(mBaseURL));
}
}
void ScriptLoadRequestList::CancelRequestsAndClear() { while (!isEmpty()) {
RefPtr<ScriptLoadRequest> first = StealFirst();
first->Cancel(); // And just let it go out of scope and die.
}
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung ist noch experimentell.