mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-27 21:00:50 +00:00
Backed out changeset 5d77f6b14633 (bug 1362119) for android bustage in nsCCUncollectableMarker.cpp:500:7: error: 'TraceScriptHolder' is not a member of 'mozilla'
--HG-- rename : dom/script/ScriptSettings.cpp => dom/base/ScriptSettings.cpp rename : dom/script/ScriptSettings.h => dom/base/ScriptSettings.h rename : dom/script/nsIScriptElement.h => dom/base/nsIScriptElement.h rename : dom/script/nsIScriptLoaderObserver.idl => dom/base/nsIScriptLoaderObserver.idl rename : dom/script/ScriptElement.cpp => dom/base/nsScriptElement.cpp rename : dom/script/ScriptElement.h => dom/base/nsScriptElement.h rename : dom/script/ScriptLoader.cpp => dom/base/nsScriptLoader.cpp rename : dom/script/ScriptLoader.h => dom/base/nsScriptLoader.h
This commit is contained in:
parent
6201e6527c
commit
f0d6de60d7
@ -6,7 +6,6 @@
|
||||
|
||||
#include "ImportManager.h"
|
||||
|
||||
#include "mozilla/dom/ScriptLoader.h"
|
||||
#include "mozilla/EventListenerManager.h"
|
||||
#include "HTMLLinkElement.h"
|
||||
#include "nsContentPolicyUtils.h"
|
||||
@ -19,6 +18,7 @@
|
||||
#include "nsIDOMEvent.h"
|
||||
#include "nsIPrincipal.h"
|
||||
#include "nsIScriptObjectPrincipal.h"
|
||||
#include "nsScriptLoader.h"
|
||||
#include "nsNetUtil.h"
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
@ -156,7 +156,7 @@ ImportLoader::Updater::UpdateMainReferrer(uint32_t aNewIdx)
|
||||
// Our nearest predecessor has changed. So let's add the ScriptLoader to the
|
||||
// new one if there is any. And remove it from the old one.
|
||||
RefPtr<ImportManager> manager = mLoader->Manager();
|
||||
ScriptLoader* loader = mLoader->mDocument->ScriptLoader();
|
||||
nsScriptLoader* loader = mLoader->mDocument->ScriptLoader();
|
||||
ImportLoader*& pred = mLoader->mBlockingPredecessor;
|
||||
ImportLoader* newPred = manager->GetNearestPredecessor(newMainReferrer);
|
||||
if (pred) {
|
||||
@ -339,7 +339,7 @@ ImportLoader::DispatchEventIfFinished(nsINode* aNode)
|
||||
}
|
||||
|
||||
void
|
||||
ImportLoader::AddBlockedScriptLoader(ScriptLoader* aScriptLoader)
|
||||
ImportLoader::AddBlockedScriptLoader(nsScriptLoader* aScriptLoader)
|
||||
{
|
||||
if (mBlockedScriptLoaders.Contains(aScriptLoader)) {
|
||||
return;
|
||||
@ -352,7 +352,7 @@ ImportLoader::AddBlockedScriptLoader(ScriptLoader* aScriptLoader)
|
||||
}
|
||||
|
||||
bool
|
||||
ImportLoader::RemoveBlockedScriptLoader(ScriptLoader* aScriptLoader)
|
||||
ImportLoader::RemoveBlockedScriptLoader(nsScriptLoader* aScriptLoader)
|
||||
{
|
||||
aScriptLoader->RemoveParserBlockingScriptExecutionBlocker();
|
||||
return mBlockedScriptLoaders.RemoveElement(aScriptLoader);
|
||||
|
@ -45,8 +45,8 @@
|
||||
#include "nsIStreamListener.h"
|
||||
#include "nsIWeakReferenceUtils.h"
|
||||
#include "nsRefPtrHashtable.h"
|
||||
#include "nsScriptLoader.h"
|
||||
#include "nsURIHashKey.h"
|
||||
#include "mozilla/dom/ScriptLoader.h"
|
||||
|
||||
class nsIDocument;
|
||||
class nsIPrincipal;
|
||||
@ -184,8 +184,8 @@ public:
|
||||
// and wait for that to run its scripts. We keep track of all the
|
||||
// ScriptRunners that are waiting for this import. NOTE: updating
|
||||
// the main referrer might change this list.
|
||||
void AddBlockedScriptLoader(ScriptLoader* aScriptLoader);
|
||||
bool RemoveBlockedScriptLoader(ScriptLoader* aScriptLoader);
|
||||
void AddBlockedScriptLoader(nsScriptLoader* aScriptLoader);
|
||||
bool RemoveBlockedScriptLoader(nsScriptLoader* aScriptLoader);
|
||||
void SetBlockingPredecessor(ImportLoader* aLoader);
|
||||
|
||||
private:
|
||||
@ -230,7 +230,7 @@ private:
|
||||
|
||||
// List of pending ScriptLoaders that are waiting for this import
|
||||
// to finish.
|
||||
nsTArray<RefPtr<ScriptLoader>> mBlockedScriptLoaders;
|
||||
nsTArray<RefPtr<nsScriptLoader>> mBlockedScriptLoaders;
|
||||
|
||||
// There is always exactly one referrer link that is flagged as
|
||||
// the main referrer the primary link. This is the one that is
|
||||
|
@ -32,9 +32,9 @@
|
||||
#include "mozilla/Likely.h"
|
||||
#include "nsCycleCollectionParticipant.h"
|
||||
#include "NullPrincipal.h"
|
||||
#include "ScriptSettings.h"
|
||||
#include "mozilla/Unused.h"
|
||||
#include "mozilla/dom/LocationBinding.h"
|
||||
#include "mozilla/dom/ScriptSettings.h"
|
||||
|
||||
namespace mozilla {
|
||||
namespace dom {
|
||||
|
@ -27,6 +27,7 @@ XPIDL_SOURCES += [
|
||||
'nsIObjectLoadingContent.idl',
|
||||
'nsIRemoteWindowContext.idl',
|
||||
'nsIScriptChannel.idl',
|
||||
'nsIScriptLoaderObserver.idl',
|
||||
'nsISelection.idl',
|
||||
'nsISelectionController.idl',
|
||||
'nsISelectionDisplay.idl',
|
||||
@ -91,6 +92,7 @@ EXPORTS += [
|
||||
'nsINode.h',
|
||||
'nsINodeList.h',
|
||||
'nsIScriptContext.h',
|
||||
'nsIScriptElement.h',
|
||||
'nsIScriptGlobalObject.h',
|
||||
'nsIScriptNameSpaceManager.h',
|
||||
'nsIScriptObjectPrincipal.h',
|
||||
@ -111,6 +113,7 @@ EXPORTS += [
|
||||
'nsRange.h',
|
||||
'nsReferencedElement.h',
|
||||
'nsSandboxFlags.h',
|
||||
'nsScriptLoader.h',
|
||||
'nsStructuredCloneContainer.h',
|
||||
'nsStubAnimationObserver.h',
|
||||
'nsStubDocumentObserver.h',
|
||||
@ -195,6 +198,7 @@ EXPORTS.mozilla.dom += [
|
||||
'ResponsiveImageSelector.h',
|
||||
'SameProcessMessageQueue.h',
|
||||
'ScreenOrientation.h',
|
||||
'ScriptSettings.h',
|
||||
'ShadowRoot.h',
|
||||
'StructuredCloneHolder.h',
|
||||
'StructuredCloneTags.h',
|
||||
@ -311,6 +315,8 @@ UNIFIED_SOURCES += [
|
||||
'nsRange.cpp',
|
||||
'nsReferencedElement.cpp',
|
||||
'nsScreen.cpp',
|
||||
'nsScriptElement.cpp',
|
||||
'nsScriptLoader.cpp',
|
||||
'nsScriptNameSpaceManager.cpp',
|
||||
'nsStructuredCloneContainer.cpp',
|
||||
'nsStubAnimationObserver.cpp',
|
||||
@ -337,6 +343,7 @@ UNIFIED_SOURCES += [
|
||||
'ResponsiveImageSelector.cpp',
|
||||
'SameProcessMessageQueue.cpp',
|
||||
'ScreenOrientation.cpp',
|
||||
'ScriptSettings.cpp',
|
||||
'ShadowRoot.cpp',
|
||||
'StructuredCloneHolder.cpp',
|
||||
'StyleSheetList.cpp',
|
||||
|
@ -32,6 +32,7 @@
|
||||
#include "nsIDocument.h"
|
||||
#include "nsIDOMEvent.h"
|
||||
#include "nsWeakPtr.h"
|
||||
#include "ScriptSettings.h"
|
||||
|
||||
using mozilla::Unused; // <snicker>
|
||||
using namespace mozilla::dom;
|
||||
|
@ -10,6 +10,7 @@
|
||||
*/
|
||||
|
||||
#include "nsContentSink.h"
|
||||
#include "nsScriptLoader.h"
|
||||
#include "nsIDocument.h"
|
||||
#include "nsIDOMDocument.h"
|
||||
#include "mozilla/css/Loader.h"
|
||||
@ -48,7 +49,6 @@
|
||||
#include "nsHTMLDNSPrefetch.h"
|
||||
#include "nsIObserverService.h"
|
||||
#include "mozilla/Preferences.h"
|
||||
#include "mozilla/dom/ScriptLoader.h"
|
||||
#include "nsParserConstants.h"
|
||||
#include "nsSandboxFlags.h"
|
||||
|
||||
|
@ -36,16 +36,13 @@ class nsIAtom;
|
||||
class nsIChannel;
|
||||
class nsIContent;
|
||||
class nsNodeInfoManager;
|
||||
class nsScriptLoader;
|
||||
class nsIApplicationCache;
|
||||
|
||||
namespace mozilla {
|
||||
namespace css {
|
||||
class Loader;
|
||||
} // namespace css
|
||||
|
||||
namespace dom {
|
||||
class ScriptLoader;
|
||||
} // namespace dom
|
||||
} // namespace mozilla
|
||||
|
||||
#ifdef DEBUG
|
||||
@ -279,7 +276,7 @@ protected:
|
||||
nsCOMPtr<nsIDocShell> mDocShell;
|
||||
RefPtr<mozilla::css::Loader> mCSSLoader;
|
||||
RefPtr<nsNodeInfoManager> mNodeInfoManager;
|
||||
RefPtr<mozilla::dom::ScriptLoader> mScriptLoader;
|
||||
RefPtr<nsScriptLoader> mScriptLoader;
|
||||
|
||||
// back off timer notification after count
|
||||
int32_t mBackoffCount;
|
||||
|
@ -2026,7 +2026,7 @@ nsDocument::Init()
|
||||
mScopeObject = do_GetWeakReference(global);
|
||||
MOZ_ASSERT(mScopeObject);
|
||||
|
||||
mScriptLoader = new dom::ScriptLoader(this);
|
||||
mScriptLoader = new nsScriptLoader(this);
|
||||
|
||||
mozilla::HoldJSObjects(this);
|
||||
|
||||
@ -5011,7 +5011,7 @@ nsDocument::GetWindowInternal() const
|
||||
return win;
|
||||
}
|
||||
|
||||
ScriptLoader*
|
||||
nsScriptLoader*
|
||||
nsDocument::ScriptLoader()
|
||||
{
|
||||
return mScriptLoader;
|
||||
|
@ -31,6 +31,7 @@
|
||||
#include "nsJSThingHashtable.h"
|
||||
#include "nsIScriptObjectPrincipal.h"
|
||||
#include "nsIURI.h"
|
||||
#include "nsScriptLoader.h"
|
||||
#include "nsIRadioGroupContainer.h"
|
||||
#include "nsILayoutHistoryState.h"
|
||||
#include "nsIRequest.h"
|
||||
@ -59,7 +60,6 @@
|
||||
#include "mozilla/MemoryReporting.h"
|
||||
#include "mozilla/PendingAnimationTracker.h"
|
||||
#include "mozilla/dom/DOMImplementation.h"
|
||||
#include "mozilla/dom/ScriptLoader.h"
|
||||
#include "mozilla/dom/StyleSheetList.h"
|
||||
#include "nsDataHashtable.h"
|
||||
#include "mozilla/TimeStamp.h"
|
||||
@ -742,7 +742,7 @@ public:
|
||||
/**
|
||||
* Get the script loader for this document
|
||||
*/
|
||||
virtual mozilla::dom::ScriptLoader* ScriptLoader() override;
|
||||
virtual nsScriptLoader* ScriptLoader() override;
|
||||
|
||||
/**
|
||||
* Add/Remove an element to the document's id and name hashes
|
||||
@ -1492,7 +1492,7 @@ public:
|
||||
RefPtr<mozilla::EventListenerManager> mListenerManager;
|
||||
RefPtr<mozilla::dom::StyleSheetList> mDOMStyleSheets;
|
||||
RefPtr<nsDOMStyleSheetSetList> mStyleSheetSetList;
|
||||
RefPtr<mozilla::dom::ScriptLoader> mScriptLoader;
|
||||
RefPtr<nsScriptLoader> mScriptLoader;
|
||||
nsDocHeaderData* mHeaderData;
|
||||
/* mIdentifierMap works as follows for IDs:
|
||||
* 1) Attribute changes affect the table immediately (removing and adding
|
||||
|
@ -18,7 +18,7 @@
|
||||
#include "nsJSUtils.h"
|
||||
#include "nsJSPrincipals.h"
|
||||
#include "nsNetUtil.h"
|
||||
#include "mozilla/dom/ScriptLoader.h"
|
||||
#include "nsScriptLoader.h"
|
||||
#include "nsFrameLoader.h"
|
||||
#include "nsIInputStream.h"
|
||||
#include "nsIXULRuntime.h"
|
||||
@ -1640,9 +1640,9 @@ nsMessageManagerScriptExecutor::TryCacheLoadAndCompileScript(
|
||||
if (NS_FAILED(NS_ReadInputStreamToString(input, buffer, avail))) {
|
||||
return;
|
||||
}
|
||||
ScriptLoader::ConvertToUTF16(channel, (uint8_t*)buffer.get(), avail,
|
||||
EmptyString(), nullptr,
|
||||
dataStringBuf, dataStringLength);
|
||||
nsScriptLoader::ConvertToUTF16(channel, (uint8_t*)buffer.get(), avail,
|
||||
EmptyString(), nullptr,
|
||||
dataStringBuf, dataStringLength);
|
||||
}
|
||||
|
||||
JS::SourceBufferHolder srcBuf(dataStringBuf, dataStringLength,
|
||||
|
@ -64,7 +64,7 @@
|
||||
#include "nsReadableUtils.h"
|
||||
#include "nsDOMClassInfo.h"
|
||||
#include "nsJSEnvironment.h"
|
||||
#include "mozilla/dom/ScriptSettings.h"
|
||||
#include "ScriptSettings.h"
|
||||
#include "mozilla/Preferences.h"
|
||||
#include "mozilla/Likely.h"
|
||||
#include "mozilla/Sprintf.h"
|
||||
|
@ -92,6 +92,7 @@ class nsIVariant;
|
||||
class nsViewManager;
|
||||
class nsPresContext;
|
||||
class nsRange;
|
||||
class nsScriptLoader;
|
||||
class nsSMILAnimationController;
|
||||
class nsSVGElement;
|
||||
class nsTextNode;
|
||||
@ -153,7 +154,6 @@ class NodeIterator;
|
||||
enum class OrientationType : uint8_t;
|
||||
class ProcessingInstruction;
|
||||
class Promise;
|
||||
class ScriptLoader;
|
||||
class StyleSheetList;
|
||||
class SVGDocument;
|
||||
class SVGSVGElement;
|
||||
@ -1368,7 +1368,7 @@ public:
|
||||
/**
|
||||
* Get the script loader for this document
|
||||
*/
|
||||
virtual mozilla::dom::ScriptLoader* ScriptLoader() = 0;
|
||||
virtual nsScriptLoader* ScriptLoader() = 0;
|
||||
|
||||
/**
|
||||
* Add/Remove an element to the document's id and name hashes
|
||||
|
@ -11,13 +11,13 @@
|
||||
#include "nsIComponentManager.h"
|
||||
#include "nsIServiceManager.h"
|
||||
#include "nsComponentManagerUtils.h"
|
||||
#include "nsScriptLoader.h"
|
||||
#include "nsFrameLoader.h"
|
||||
#include "xpcpublic.h"
|
||||
#include "nsIMozBrowserFrame.h"
|
||||
#include "nsDOMClassInfoID.h"
|
||||
#include "mozilla/EventDispatcher.h"
|
||||
#include "mozilla/dom/SameProcessMessageQueue.h"
|
||||
#include "mozilla/dom/ScriptLoader.h"
|
||||
|
||||
using namespace mozilla;
|
||||
using namespace mozilla::dom;
|
||||
|
@ -37,6 +37,7 @@
|
||||
#include "nsXPCOMCIDInternal.h"
|
||||
#include "nsIXULRuntime.h"
|
||||
#include "nsTextFormatter.h"
|
||||
#include "ScriptSettings.h"
|
||||
#ifdef XP_WIN
|
||||
#include <process.h>
|
||||
#define getpid _getpid
|
||||
@ -59,7 +60,6 @@
|
||||
#include "mozilla/dom/DOMException.h"
|
||||
#include "mozilla/dom/DOMExceptionBinding.h"
|
||||
#include "mozilla/dom/ErrorEvent.h"
|
||||
#include "mozilla/dom/ScriptSettings.h"
|
||||
#include "nsAXPCNativeCallContext.h"
|
||||
#include "mozilla/CycleCollectedJSRuntime.h"
|
||||
#include "mozilla/SystemGroup.h"
|
||||
|
@ -4,13 +4,13 @@
|
||||
* 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 "ScriptElement.h"
|
||||
#include "ScriptLoader.h"
|
||||
#include "nsScriptElement.h"
|
||||
#include "mozilla/BasicEvents.h"
|
||||
#include "mozilla/EventDispatcher.h"
|
||||
#include "mozilla/dom/Element.h"
|
||||
#include "nsContentUtils.h"
|
||||
#include "nsPresContext.h"
|
||||
#include "nsScriptLoader.h"
|
||||
#include "nsIParser.h"
|
||||
#include "nsGkAtoms.h"
|
||||
#include "nsContentSink.h"
|
||||
@ -19,11 +19,11 @@ using namespace mozilla;
|
||||
using namespace mozilla::dom;
|
||||
|
||||
NS_IMETHODIMP
|
||||
ScriptElement::ScriptAvailable(nsresult aResult,
|
||||
nsIScriptElement *aElement,
|
||||
bool aIsInline,
|
||||
nsIURI *aURI,
|
||||
int32_t aLineNo)
|
||||
nsScriptElement::ScriptAvailable(nsresult aResult,
|
||||
nsIScriptElement *aElement,
|
||||
bool aIsInline,
|
||||
nsIURI *aURI,
|
||||
int32_t aLineNo)
|
||||
{
|
||||
if (!aIsInline && NS_FAILED(aResult)) {
|
||||
nsCOMPtr<nsIParser> parser = do_QueryReferent(mCreatorParser);
|
||||
@ -40,7 +40,7 @@ ScriptElement::ScriptAvailable(nsresult aResult,
|
||||
}
|
||||
|
||||
/* virtual */ nsresult
|
||||
ScriptElement::FireErrorEvent()
|
||||
nsScriptElement::FireErrorEvent()
|
||||
{
|
||||
nsCOMPtr<nsIContent> cont =
|
||||
do_QueryInterface((nsIScriptElement*) this);
|
||||
@ -53,9 +53,9 @@ ScriptElement::FireErrorEvent()
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
ScriptElement::ScriptEvaluated(nsresult aResult,
|
||||
nsIScriptElement *aElement,
|
||||
bool aIsInline)
|
||||
nsScriptElement::ScriptEvaluated(nsresult aResult,
|
||||
nsIScriptElement *aElement,
|
||||
bool aIsInline)
|
||||
{
|
||||
nsresult rv = NS_OK;
|
||||
if (!aIsInline) {
|
||||
@ -78,44 +78,44 @@ ScriptElement::ScriptEvaluated(nsresult aResult,
|
||||
}
|
||||
|
||||
void
|
||||
ScriptElement::CharacterDataChanged(nsIDocument *aDocument,
|
||||
nsIContent* aContent,
|
||||
CharacterDataChangeInfo* aInfo)
|
||||
nsScriptElement::CharacterDataChanged(nsIDocument *aDocument,
|
||||
nsIContent* aContent,
|
||||
CharacterDataChangeInfo* aInfo)
|
||||
{
|
||||
MaybeProcessScript();
|
||||
}
|
||||
|
||||
void
|
||||
ScriptElement::AttributeChanged(nsIDocument* aDocument,
|
||||
Element* aElement,
|
||||
int32_t aNameSpaceID,
|
||||
nsIAtom* aAttribute,
|
||||
int32_t aModType,
|
||||
const nsAttrValue* aOldValue)
|
||||
nsScriptElement::AttributeChanged(nsIDocument* aDocument,
|
||||
Element* aElement,
|
||||
int32_t aNameSpaceID,
|
||||
nsIAtom* aAttribute,
|
||||
int32_t aModType,
|
||||
const nsAttrValue* aOldValue)
|
||||
{
|
||||
MaybeProcessScript();
|
||||
}
|
||||
|
||||
void
|
||||
ScriptElement::ContentAppended(nsIDocument* aDocument,
|
||||
nsIContent* aContainer,
|
||||
nsIContent* aFirstNewContent,
|
||||
int32_t aNewIndexInContainer)
|
||||
nsScriptElement::ContentAppended(nsIDocument* aDocument,
|
||||
nsIContent* aContainer,
|
||||
nsIContent* aFirstNewContent,
|
||||
int32_t aNewIndexInContainer)
|
||||
{
|
||||
MaybeProcessScript();
|
||||
}
|
||||
|
||||
void
|
||||
ScriptElement::ContentInserted(nsIDocument *aDocument,
|
||||
nsIContent* aContainer,
|
||||
nsIContent* aChild,
|
||||
int32_t aIndexInContainer)
|
||||
nsScriptElement::ContentInserted(nsIDocument *aDocument,
|
||||
nsIContent* aContainer,
|
||||
nsIContent* aChild,
|
||||
int32_t aIndexInContainer)
|
||||
{
|
||||
MaybeProcessScript();
|
||||
}
|
||||
|
||||
bool
|
||||
ScriptElement::MaybeProcessScript()
|
||||
nsScriptElement::MaybeProcessScript()
|
||||
{
|
||||
nsCOMPtr<nsIContent> cont =
|
||||
do_QueryInterface((nsIScriptElement*) this);
|
||||
@ -145,6 +145,6 @@ ScriptElement::MaybeProcessScript()
|
||||
}
|
||||
}
|
||||
|
||||
RefPtr<ScriptLoader> loader = ownerDoc->ScriptLoader();
|
||||
RefPtr<nsScriptLoader> loader = ownerDoc->ScriptLoader();
|
||||
return loader->ProcessScriptElement(this);
|
||||
}
|
@ -4,25 +4,22 @@
|
||||
* 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/. */
|
||||
|
||||
#ifndef mozilla_dom_ScriptElement_h
|
||||
#define mozilla_dom_ScriptElement_h
|
||||
#ifndef nsScriptElement_h
|
||||
#define nsScriptElement_h
|
||||
|
||||
#include "mozilla/Attributes.h"
|
||||
#include "nsIScriptLoaderObserver.h"
|
||||
#include "nsIScriptElement.h"
|
||||
#include "nsStubMutationObserver.h"
|
||||
|
||||
namespace mozilla {
|
||||
namespace dom {
|
||||
|
||||
/**
|
||||
* Baseclass useful for script elements (such as <xhtml:script> and
|
||||
* <svg:script>). Currently the class assumes that only the 'src'
|
||||
* attribute and the children of the class affect what script to execute.
|
||||
*/
|
||||
|
||||
class ScriptElement : public nsIScriptElement,
|
||||
public nsStubMutationObserver
|
||||
class nsScriptElement : public nsIScriptElement,
|
||||
public nsStubMutationObserver
|
||||
{
|
||||
public:
|
||||
// nsIScriptLoaderObserver
|
||||
@ -34,7 +31,7 @@ public:
|
||||
NS_DECL_NSIMUTATIONOBSERVER_CONTENTAPPENDED
|
||||
NS_DECL_NSIMUTATIONOBSERVER_CONTENTINSERTED
|
||||
|
||||
explicit ScriptElement(FromParser aFromParser)
|
||||
explicit nsScriptElement(mozilla::dom::FromParser aFromParser)
|
||||
: nsIScriptElement(aFromParser)
|
||||
{
|
||||
}
|
||||
@ -52,7 +49,4 @@ protected:
|
||||
virtual bool MaybeProcessScript() override;
|
||||
};
|
||||
|
||||
} // dom namespace
|
||||
} // mozilla namespace
|
||||
|
||||
#endif // mozilla_dom_ScriptElement_h
|
||||
#endif // nsScriptElement_h
|
File diff suppressed because it is too large
Load Diff
@ -8,8 +8,8 @@
|
||||
* A class that handles loading and evaluation of <script> elements.
|
||||
*/
|
||||
|
||||
#ifndef mozilla_dom_ScriptLoader_h
|
||||
#define mozilla_dom_ScriptLoader_h
|
||||
#ifndef __nsScriptLoader_h__
|
||||
#define __nsScriptLoader_h__
|
||||
|
||||
#include "nsCOMPtr.h"
|
||||
#include "nsRefPtrHashtable.h"
|
||||
@ -31,6 +31,9 @@
|
||||
#include "mozilla/net/ReferrerPolicy.h"
|
||||
#include "mozilla/Vector.h"
|
||||
|
||||
class nsModuleLoadRequest;
|
||||
class nsModuleScript;
|
||||
class nsScriptLoadRequestList;
|
||||
class nsIURI;
|
||||
|
||||
namespace JS {
|
||||
@ -39,36 +42,34 @@ namespace JS {
|
||||
|
||||
namespace mozilla {
|
||||
namespace dom {
|
||||
|
||||
class AutoJSAPI;
|
||||
class ModuleLoadRequest;
|
||||
class ModuleScript;
|
||||
class ScriptLoadRequestList;
|
||||
} // namespace dom
|
||||
} // namespace mozilla
|
||||
|
||||
//////////////////////////////////////////////////////////////
|
||||
// Per-request data structure
|
||||
//////////////////////////////////////////////////////////////
|
||||
|
||||
enum class ScriptKind {
|
||||
enum class nsScriptKind {
|
||||
Classic,
|
||||
Module
|
||||
};
|
||||
|
||||
class ScriptLoadRequest : public nsISupports,
|
||||
private mozilla::LinkedListElement<ScriptLoadRequest>
|
||||
class nsScriptLoadRequest : public nsISupports,
|
||||
private mozilla::LinkedListElement<nsScriptLoadRequest>
|
||||
{
|
||||
typedef LinkedListElement<ScriptLoadRequest> super;
|
||||
typedef LinkedListElement<nsScriptLoadRequest> super;
|
||||
|
||||
// Allow LinkedListElement<ScriptLoadRequest> to cast us to itself as needed.
|
||||
friend class mozilla::LinkedListElement<ScriptLoadRequest>;
|
||||
friend class ScriptLoadRequestList;
|
||||
// Allow LinkedListElement<nsScriptLoadRequest> to cast us to itself as needed.
|
||||
friend class mozilla::LinkedListElement<nsScriptLoadRequest>;
|
||||
friend class nsScriptLoadRequestList;
|
||||
|
||||
protected:
|
||||
virtual ~ScriptLoadRequest();
|
||||
virtual ~nsScriptLoadRequest();
|
||||
|
||||
public:
|
||||
ScriptLoadRequest(ScriptKind aKind,
|
||||
nsIScriptElement* aElement,
|
||||
nsScriptLoadRequest(nsScriptKind aKind,
|
||||
nsIScriptElement* aElement,
|
||||
uint32_t aVersion,
|
||||
mozilla::CORSMode aCORSMode,
|
||||
const mozilla::dom::SRIMetadata &aIntegrity)
|
||||
@ -99,14 +100,14 @@ public:
|
||||
}
|
||||
|
||||
NS_DECL_CYCLE_COLLECTING_ISUPPORTS
|
||||
NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(ScriptLoadRequest)
|
||||
NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(nsScriptLoadRequest)
|
||||
|
||||
bool IsModuleRequest() const
|
||||
{
|
||||
return mKind == ScriptKind::Module;
|
||||
return mKind == nsScriptKind::Module;
|
||||
}
|
||||
|
||||
ModuleLoadRequest* AsModuleRequest();
|
||||
nsModuleLoadRequest* AsModuleRequest();
|
||||
|
||||
void FireScriptAvailable(nsresult aResult)
|
||||
{
|
||||
@ -192,7 +193,7 @@ public:
|
||||
using super::getNext;
|
||||
using super::isInList;
|
||||
|
||||
const ScriptKind mKind;
|
||||
const nsScriptKind mKind;
|
||||
nsCOMPtr<nsIScriptElement> mElement;
|
||||
bool mScriptFromHead; // Synchronous head script block loading of other non js/css content.
|
||||
Progress mProgress; // Are we still waiting for a load to complete?
|
||||
@ -236,23 +237,23 @@ public:
|
||||
nsCOMPtr<nsICacheInfoChannel> mCacheInfo;
|
||||
};
|
||||
|
||||
class ScriptLoadRequestList : private mozilla::LinkedList<ScriptLoadRequest>
|
||||
class nsScriptLoadRequestList : private mozilla::LinkedList<nsScriptLoadRequest>
|
||||
{
|
||||
typedef mozilla::LinkedList<ScriptLoadRequest> super;
|
||||
typedef mozilla::LinkedList<nsScriptLoadRequest> super;
|
||||
|
||||
public:
|
||||
~ScriptLoadRequestList();
|
||||
~nsScriptLoadRequestList();
|
||||
|
||||
void Clear();
|
||||
|
||||
#ifdef DEBUG
|
||||
bool Contains(ScriptLoadRequest* aElem) const;
|
||||
bool Contains(nsScriptLoadRequest* aElem) const;
|
||||
#endif // DEBUG
|
||||
|
||||
using super::getFirst;
|
||||
using super::isEmpty;
|
||||
|
||||
void AppendElement(ScriptLoadRequest* aElem)
|
||||
void AppendElement(nsScriptLoadRequest* aElem)
|
||||
{
|
||||
MOZ_ASSERT(!aElem->isInList());
|
||||
NS_ADDREF(aElem);
|
||||
@ -260,20 +261,20 @@ public:
|
||||
}
|
||||
|
||||
MOZ_MUST_USE
|
||||
already_AddRefed<ScriptLoadRequest> Steal(ScriptLoadRequest* aElem)
|
||||
already_AddRefed<nsScriptLoadRequest> Steal(nsScriptLoadRequest* aElem)
|
||||
{
|
||||
aElem->removeFrom(*this);
|
||||
return dont_AddRef(aElem);
|
||||
}
|
||||
|
||||
MOZ_MUST_USE
|
||||
already_AddRefed<ScriptLoadRequest> StealFirst()
|
||||
already_AddRefed<nsScriptLoadRequest> StealFirst()
|
||||
{
|
||||
MOZ_ASSERT(!isEmpty());
|
||||
return Steal(getFirst());
|
||||
}
|
||||
|
||||
void Remove(ScriptLoadRequest* aElem)
|
||||
void Remove(nsScriptLoadRequest* aElem)
|
||||
{
|
||||
aElem->removeFrom(*this);
|
||||
NS_RELEASE(aElem);
|
||||
@ -284,12 +285,12 @@ public:
|
||||
// Script loader implementation
|
||||
//////////////////////////////////////////////////////////////
|
||||
|
||||
class ScriptLoader final : public nsISupports
|
||||
class nsScriptLoader final : public nsISupports
|
||||
{
|
||||
class MOZ_STACK_CLASS AutoCurrentScriptUpdater
|
||||
{
|
||||
public:
|
||||
AutoCurrentScriptUpdater(ScriptLoader* aScriptLoader,
|
||||
AutoCurrentScriptUpdater(nsScriptLoader* aScriptLoader,
|
||||
nsIScriptElement* aCurrentScript)
|
||||
: mOldScript(aScriptLoader->mCurrentScript)
|
||||
, mScriptLoader(aScriptLoader)
|
||||
@ -302,19 +303,19 @@ class ScriptLoader final : public nsISupports
|
||||
}
|
||||
private:
|
||||
nsCOMPtr<nsIScriptElement> mOldScript;
|
||||
ScriptLoader* mScriptLoader;
|
||||
nsScriptLoader* mScriptLoader;
|
||||
};
|
||||
|
||||
friend class ModuleLoadRequest;
|
||||
friend class ScriptRequestProcessor;
|
||||
friend class ScriptLoadHandler;
|
||||
friend class nsModuleLoadRequest;
|
||||
friend class nsScriptRequestProcessor;
|
||||
friend class nsScriptLoadHandler;
|
||||
friend class AutoCurrentScriptUpdater;
|
||||
|
||||
public:
|
||||
explicit ScriptLoader(nsIDocument* aDocument);
|
||||
explicit nsScriptLoader(nsIDocument* aDocument);
|
||||
|
||||
NS_DECL_CYCLE_COLLECTING_ISUPPORTS
|
||||
NS_DECL_CYCLE_COLLECTION_CLASS(ScriptLoader)
|
||||
NS_DECL_CYCLE_COLLECTION_CLASS(nsScriptLoader)
|
||||
|
||||
/**
|
||||
* The loader maintains a weak reference to the document with
|
||||
@ -467,12 +468,12 @@ public:
|
||||
|
||||
/**
|
||||
* Handle the completion of a stream. This is called by the
|
||||
* ScriptLoadHandler object which observes the IncrementalStreamLoader
|
||||
* nsScriptLoadHandler object which observes the IncrementalStreamLoader
|
||||
* loading the script. The streamed content is expected to be stored on the
|
||||
* aRequest argument.
|
||||
*/
|
||||
nsresult OnStreamComplete(nsIIncrementalStreamLoader* aLoader,
|
||||
ScriptLoadRequest* aRequest,
|
||||
nsScriptLoadRequest* aRequest,
|
||||
nsresult aChannelStatus,
|
||||
nsresult aSRIStatus,
|
||||
mozilla::dom::SRICheckDataVerifier* aSRIDataVerifier);
|
||||
@ -540,9 +541,9 @@ public:
|
||||
* Process a request that was deferred so that the script could be compiled
|
||||
* off thread.
|
||||
*/
|
||||
nsresult ProcessOffThreadRequest(ScriptLoadRequest *aRequest);
|
||||
nsresult ProcessOffThreadRequest(nsScriptLoadRequest *aRequest);
|
||||
|
||||
bool AddPendingChildLoader(ScriptLoader* aChild) {
|
||||
bool AddPendingChildLoader(nsScriptLoader* aChild) {
|
||||
return mPendingChildLoaders.AppendElement(aChild) != nullptr;
|
||||
}
|
||||
|
||||
@ -559,10 +560,10 @@ public:
|
||||
void LoadEventFired();
|
||||
|
||||
private:
|
||||
virtual ~ScriptLoader();
|
||||
virtual ~nsScriptLoader();
|
||||
|
||||
ScriptLoadRequest* CreateLoadRequest(
|
||||
ScriptKind aKind,
|
||||
nsScriptLoadRequest* CreateLoadRequest(
|
||||
nsScriptKind aKind,
|
||||
nsIScriptElement* aElement,
|
||||
uint32_t aVersion,
|
||||
mozilla::CORSMode aCORSMode,
|
||||
@ -571,12 +572,12 @@ private:
|
||||
/**
|
||||
* Unblocks the creator parser of the parser-blocking scripts.
|
||||
*/
|
||||
void UnblockParser(ScriptLoadRequest* aParserBlockingRequest);
|
||||
void UnblockParser(nsScriptLoadRequest* aParserBlockingRequest);
|
||||
|
||||
/**
|
||||
* Asynchronously resumes the creator parser of the parser-blocking scripts.
|
||||
*/
|
||||
void ContinueParserAsync(ScriptLoadRequest* aParserBlockingRequest);
|
||||
void ContinueParserAsync(nsScriptLoadRequest* aParserBlockingRequest);
|
||||
|
||||
|
||||
/**
|
||||
@ -591,14 +592,14 @@ private:
|
||||
/**
|
||||
* Start a load for aRequest's URI.
|
||||
*/
|
||||
nsresult StartLoad(ScriptLoadRequest *aRequest);
|
||||
nsresult StartLoad(nsScriptLoadRequest *aRequest);
|
||||
|
||||
/**
|
||||
* Abort the current stream, and re-start with a new load request from scratch
|
||||
* without requesting any alternate data. Returns NS_BINDING_RETARGETED on
|
||||
* success, as this error code is used to abort the input stream.
|
||||
*/
|
||||
nsresult RestartLoad(ScriptLoadRequest *aRequest);
|
||||
nsresult RestartLoad(nsScriptLoadRequest *aRequest);
|
||||
|
||||
/**
|
||||
* Process any pending requests asynchronously (i.e. off an event) if there
|
||||
@ -634,14 +635,14 @@ private:
|
||||
return mEnabled && !mBlockerCount;
|
||||
}
|
||||
|
||||
nsresult AttemptAsyncScriptCompile(ScriptLoadRequest* aRequest);
|
||||
nsresult ProcessRequest(ScriptLoadRequest* aRequest);
|
||||
nsresult CompileOffThreadOrProcessRequest(ScriptLoadRequest* aRequest);
|
||||
nsresult AttemptAsyncScriptCompile(nsScriptLoadRequest* aRequest);
|
||||
nsresult ProcessRequest(nsScriptLoadRequest* aRequest);
|
||||
nsresult CompileOffThreadOrProcessRequest(nsScriptLoadRequest* aRequest);
|
||||
void FireScriptAvailable(nsresult aResult,
|
||||
ScriptLoadRequest* aRequest);
|
||||
nsScriptLoadRequest* aRequest);
|
||||
void FireScriptEvaluated(nsresult aResult,
|
||||
ScriptLoadRequest* aRequest);
|
||||
nsresult EvaluateScript(ScriptLoadRequest* aRequest);
|
||||
nsScriptLoadRequest* aRequest);
|
||||
nsresult EvaluateScript(nsScriptLoadRequest* aRequest);
|
||||
|
||||
/**
|
||||
* Queue the current script load request to be saved, when the page
|
||||
@ -649,7 +650,7 @@ private:
|
||||
* time when the load event got received, and when no more scripts are waiting
|
||||
* to be executed.
|
||||
*/
|
||||
void RegisterForBytecodeEncoding(ScriptLoadRequest* aRequest);
|
||||
void RegisterForBytecodeEncoding(nsScriptLoadRequest* aRequest);
|
||||
|
||||
/**
|
||||
* Check if all conditions are met, i-e that the onLoad event fired and that
|
||||
@ -663,81 +664,81 @@ private:
|
||||
* functions on the cache provided by the channel.
|
||||
*/
|
||||
void EncodeBytecode();
|
||||
void EncodeRequestBytecode(JSContext* aCx, ScriptLoadRequest* aRequest);
|
||||
void EncodeRequestBytecode(JSContext* aCx, nsScriptLoadRequest* aRequest);
|
||||
|
||||
void GiveUpBytecodeEncoding();
|
||||
|
||||
already_AddRefed<nsIScriptGlobalObject> GetScriptGlobalObject();
|
||||
nsresult FillCompileOptionsForRequest(const mozilla::dom::AutoJSAPI& jsapi,
|
||||
ScriptLoadRequest* aRequest,
|
||||
nsScriptLoadRequest* aRequest,
|
||||
JS::Handle<JSObject*> aScopeChain,
|
||||
JS::CompileOptions* aOptions);
|
||||
|
||||
uint32_t NumberOfProcessors();
|
||||
nsresult PrepareLoadedRequest(ScriptLoadRequest* aRequest,
|
||||
nsresult PrepareLoadedRequest(nsScriptLoadRequest* aRequest,
|
||||
nsIIncrementalStreamLoader* aLoader,
|
||||
nsresult aStatus);
|
||||
|
||||
void AddDeferRequest(ScriptLoadRequest* aRequest);
|
||||
void AddDeferRequest(nsScriptLoadRequest* aRequest);
|
||||
bool MaybeRemovedDeferRequests();
|
||||
|
||||
void MaybeMoveToLoadedList(ScriptLoadRequest* aRequest);
|
||||
void MaybeMoveToLoadedList(nsScriptLoadRequest* aRequest);
|
||||
|
||||
JS::SourceBufferHolder GetScriptSource(ScriptLoadRequest* aRequest,
|
||||
JS::SourceBufferHolder GetScriptSource(nsScriptLoadRequest* aRequest,
|
||||
nsAutoString& inlineData);
|
||||
|
||||
bool ModuleScriptsEnabled();
|
||||
|
||||
void SetModuleFetchStarted(ModuleLoadRequest *aRequest);
|
||||
void SetModuleFetchFinishedAndResumeWaitingRequests(ModuleLoadRequest *aRequest,
|
||||
void SetModuleFetchStarted(nsModuleLoadRequest *aRequest);
|
||||
void SetModuleFetchFinishedAndResumeWaitingRequests(nsModuleLoadRequest *aRequest,
|
||||
nsresult aResult);
|
||||
|
||||
bool IsFetchingModule(ModuleLoadRequest *aRequest) const;
|
||||
bool IsFetchingModule(nsModuleLoadRequest *aRequest) const;
|
||||
|
||||
bool ModuleMapContainsModule(ModuleLoadRequest *aRequest) const;
|
||||
RefPtr<mozilla::GenericPromise> WaitForModuleFetch(ModuleLoadRequest *aRequest);
|
||||
ModuleScript* GetFetchedModule(nsIURI* aURL) const;
|
||||
bool ModuleMapContainsModule(nsModuleLoadRequest *aRequest) const;
|
||||
RefPtr<mozilla::GenericPromise> WaitForModuleFetch(nsModuleLoadRequest *aRequest);
|
||||
nsModuleScript* GetFetchedModule(nsIURI* aURL) const;
|
||||
|
||||
friend bool
|
||||
HostResolveImportedModule(JSContext* aCx, unsigned argc, JS::Value* vp);
|
||||
|
||||
nsresult CreateModuleScript(ModuleLoadRequest* aRequest);
|
||||
nsresult ProcessFetchedModuleSource(ModuleLoadRequest* aRequest);
|
||||
void ProcessLoadedModuleTree(ModuleLoadRequest* aRequest);
|
||||
bool InstantiateModuleTree(ModuleLoadRequest* aRequest);
|
||||
void StartFetchingModuleDependencies(ModuleLoadRequest* aRequest);
|
||||
nsresult CreateModuleScript(nsModuleLoadRequest* aRequest);
|
||||
nsresult ProcessFetchedModuleSource(nsModuleLoadRequest* aRequest);
|
||||
void ProcessLoadedModuleTree(nsModuleLoadRequest* aRequest);
|
||||
bool InstantiateModuleTree(nsModuleLoadRequest* aRequest);
|
||||
void StartFetchingModuleDependencies(nsModuleLoadRequest* aRequest);
|
||||
|
||||
RefPtr<mozilla::GenericPromise>
|
||||
StartFetchingModuleAndDependencies(ModuleLoadRequest* aRequest, nsIURI* aURI);
|
||||
StartFetchingModuleAndDependencies(nsModuleLoadRequest* aRequest, nsIURI* aURI);
|
||||
|
||||
nsIDocument* mDocument; // [WEAK]
|
||||
nsCOMArray<nsIScriptLoaderObserver> mObservers;
|
||||
ScriptLoadRequestList mNonAsyncExternalScriptInsertedRequests;
|
||||
nsScriptLoadRequestList mNonAsyncExternalScriptInsertedRequests;
|
||||
// mLoadingAsyncRequests holds async requests while they're loading; when they
|
||||
// have been loaded they are moved to mLoadedAsyncRequests.
|
||||
ScriptLoadRequestList mLoadingAsyncRequests;
|
||||
ScriptLoadRequestList mLoadedAsyncRequests;
|
||||
ScriptLoadRequestList mDeferRequests;
|
||||
ScriptLoadRequestList mXSLTRequests;
|
||||
RefPtr<ScriptLoadRequest> mParserBlockingRequest;
|
||||
nsScriptLoadRequestList mLoadingAsyncRequests;
|
||||
nsScriptLoadRequestList mLoadedAsyncRequests;
|
||||
nsScriptLoadRequestList mDeferRequests;
|
||||
nsScriptLoadRequestList mXSLTRequests;
|
||||
RefPtr<nsScriptLoadRequest> mParserBlockingRequest;
|
||||
|
||||
// List of script load request that are holding a buffer which has to be saved
|
||||
// on the cache.
|
||||
ScriptLoadRequestList mBytecodeEncodingQueue;
|
||||
nsScriptLoadRequestList mBytecodeEncodingQueue;
|
||||
|
||||
// In mRequests, the additional information here is stored by the element.
|
||||
struct PreloadInfo {
|
||||
RefPtr<ScriptLoadRequest> mRequest;
|
||||
RefPtr<nsScriptLoadRequest> mRequest;
|
||||
nsString mCharset;
|
||||
};
|
||||
|
||||
friend void ImplCycleCollectionUnlink(ScriptLoader::PreloadInfo& aField);
|
||||
friend void ImplCycleCollectionUnlink(nsScriptLoader::PreloadInfo& aField);
|
||||
friend void ImplCycleCollectionTraverse(nsCycleCollectionTraversalCallback& aCallback,
|
||||
ScriptLoader::PreloadInfo& aField,
|
||||
nsScriptLoader::PreloadInfo& aField,
|
||||
const char* aName, uint32_t aFlags);
|
||||
|
||||
struct PreloadRequestComparator {
|
||||
bool Equals(const PreloadInfo &aPi, ScriptLoadRequest * const &aRequest)
|
||||
bool Equals(const PreloadInfo &aPi, nsScriptLoadRequest * const &aRequest)
|
||||
const
|
||||
{
|
||||
return aRequest == aPi.mRequest;
|
||||
@ -750,7 +751,7 @@ private:
|
||||
|
||||
nsCOMPtr<nsIScriptElement> mCurrentScript;
|
||||
nsCOMPtr<nsIScriptElement> mCurrentParserInsertedScript;
|
||||
nsTArray< RefPtr<ScriptLoader> > mPendingChildLoaders;
|
||||
nsTArray< RefPtr<nsScriptLoader> > mPendingChildLoaders;
|
||||
uint32_t mParserBlockingBlockerCount;
|
||||
uint32_t mBlockerCount;
|
||||
uint32_t mNumberOfProcessors;
|
||||
@ -762,23 +763,23 @@ private:
|
||||
|
||||
// Module map
|
||||
nsRefPtrHashtable<nsURIHashKey, mozilla::GenericPromise::Private> mFetchingModules;
|
||||
nsRefPtrHashtable<nsURIHashKey, ModuleScript> mFetchedModules;
|
||||
nsRefPtrHashtable<nsURIHashKey, nsModuleScript> mFetchedModules;
|
||||
|
||||
nsCOMPtr<nsIConsoleReportCollector> mReporter;
|
||||
};
|
||||
|
||||
class ScriptLoadHandler final : public nsIIncrementalStreamLoaderObserver
|
||||
class nsScriptLoadHandler final : public nsIIncrementalStreamLoaderObserver
|
||||
{
|
||||
public:
|
||||
explicit ScriptLoadHandler(ScriptLoader* aScriptLoader,
|
||||
ScriptLoadRequest *aRequest,
|
||||
mozilla::dom::SRICheckDataVerifier *aSRIDataVerifier);
|
||||
explicit nsScriptLoadHandler(nsScriptLoader* aScriptLoader,
|
||||
nsScriptLoadRequest *aRequest,
|
||||
mozilla::dom::SRICheckDataVerifier *aSRIDataVerifier);
|
||||
|
||||
NS_DECL_ISUPPORTS
|
||||
NS_DECL_NSIINCREMENTALSTREAMLOADEROBSERVER
|
||||
|
||||
private:
|
||||
virtual ~ScriptLoadHandler();
|
||||
virtual ~nsScriptLoadHandler();
|
||||
|
||||
/*
|
||||
* Once the charset is found by the EnsureDecoder function, we can
|
||||
@ -809,10 +810,10 @@ private:
|
||||
nsresult EnsureKnownDataType(nsIIncrementalStreamLoader *aLoader);
|
||||
|
||||
// ScriptLoader which will handle the parsed script.
|
||||
RefPtr<ScriptLoader> mScriptLoader;
|
||||
RefPtr<nsScriptLoader> mScriptLoader;
|
||||
|
||||
// The ScriptLoadRequest for this load. Decoded data are accumulated on it.
|
||||
RefPtr<ScriptLoadRequest> mRequest;
|
||||
// The nsScriptLoadRequest for this load. Decoded data are accumulated on it.
|
||||
RefPtr<nsScriptLoadRequest> mRequest;
|
||||
|
||||
// SRI data verifier.
|
||||
nsAutoPtr<mozilla::dom::SRICheckDataVerifier> mSRIDataVerifier;
|
||||
@ -844,10 +845,7 @@ public:
|
||||
}
|
||||
|
||||
bool mWasEnabled;
|
||||
RefPtr<ScriptLoader> mLoader;
|
||||
RefPtr<nsScriptLoader> mLoader;
|
||||
};
|
||||
|
||||
} // namespace dom
|
||||
} // namespace mozilla
|
||||
|
||||
#endif // mozilla_dom_ScriptLoader_h
|
||||
#endif //__nsScriptLoader_h__
|
@ -2,7 +2,7 @@
|
||||
<html>
|
||||
<!-- https://bugzilla.mozilla.org/show_bug.cgi?id=900784 -->
|
||||
<!-- The JS bytecode cache is not supposed to be observable. To make it
|
||||
observable, the ScriptLoader is instrumented to trigger events on the
|
||||
observable, the nsScriptLoader is instrumented to trigger events on the
|
||||
script tag. These events are followed to reconstruct the code path taken by
|
||||
the script loader and associate a simple name which is checked in these
|
||||
test cases.
|
||||
@ -14,7 +14,7 @@
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script type="application/javascript">
|
||||
// This is the state machine of the trace events produced by the
|
||||
// ScriptLoader. This state machine is used to give a name to each
|
||||
// nsScriptLoader. This state machine is used to give a name to each
|
||||
// code path, such that we can assert each code path with a single word.
|
||||
var scriptLoaderStateMachine = {
|
||||
"scriptloader_load_source": {
|
||||
@ -112,7 +112,7 @@
|
||||
promise_test(async function() {
|
||||
// Setting dom.expose_test_interfaces pref causes the
|
||||
// nsScriptLoadRequest to fire event on script tags, with information
|
||||
// about its internal state. The ScriptLoader source send events to
|
||||
// about its internal state. The nsScriptLoader source send events to
|
||||
// trace these and resolve a promise with the path taken by the
|
||||
// script loader.
|
||||
//
|
||||
|
@ -12,7 +12,6 @@
|
||||
#include "mozilla/dom/File.h"
|
||||
#include "mozilla/dom/FunctionBinding.h"
|
||||
#include "mozilla/dom/Performance.h"
|
||||
#include "mozilla/dom/ScriptSettings.h"
|
||||
#include "mozilla/dom/StructuredCloneHolder.h"
|
||||
#include "mozilla/dom/ToJSValue.h"
|
||||
#include "mozilla/dom/WorkletGlobalScope.h"
|
||||
@ -23,6 +22,7 @@
|
||||
#include "nsGlobalWindow.h"
|
||||
#include "nsJSUtils.h"
|
||||
#include "nsNetUtil.h"
|
||||
#include "ScriptSettings.h"
|
||||
#include "WorkerPrivate.h"
|
||||
#include "WorkerRunnable.h"
|
||||
#include "WorkerScope.h"
|
||||
|
@ -8,7 +8,7 @@
|
||||
#include "nsIDocument.h"
|
||||
#include "mozilla/Sprintf.h"
|
||||
#include "nsGlobalWindow.h"
|
||||
#include "mozilla/dom/ScriptSettings.h"
|
||||
#include "ScriptSettings.h"
|
||||
#include "mozilla/DOMEventTargetHelper.h"
|
||||
#include "mozilla/EventDispatcher.h"
|
||||
#include "mozilla/EventListenerManager.h"
|
||||
|
@ -38,7 +38,7 @@ HTMLScriptElement::WrapNode(JSContext *aCx, JS::Handle<JSObject*> aGivenProto)
|
||||
HTMLScriptElement::HTMLScriptElement(already_AddRefed<mozilla::dom::NodeInfo>& aNodeInfo,
|
||||
FromParser aFromParser)
|
||||
: nsGenericHTMLElement(aNodeInfo)
|
||||
, ScriptElement(aFromParser)
|
||||
, nsScriptElement(aFromParser)
|
||||
{
|
||||
AddMutationObserver(this);
|
||||
}
|
||||
|
@ -8,16 +8,16 @@
|
||||
#define mozilla_dom_HTMLScriptElement_h
|
||||
|
||||
#include "nsIDOMHTMLScriptElement.h"
|
||||
#include "nsScriptElement.h"
|
||||
#include "nsGenericHTMLElement.h"
|
||||
#include "mozilla/Attributes.h"
|
||||
#include "mozilla/dom/ScriptElement.h"
|
||||
|
||||
namespace mozilla {
|
||||
namespace dom {
|
||||
|
||||
class HTMLScriptElement final : public nsGenericHTMLElement,
|
||||
public nsIDOMHTMLScriptElement,
|
||||
public ScriptElement
|
||||
public nsScriptElement
|
||||
{
|
||||
public:
|
||||
using Element::GetText;
|
||||
@ -97,8 +97,7 @@ protected:
|
||||
virtual ~HTMLScriptElement();
|
||||
|
||||
virtual JSObject* WrapNode(JSContext *aCx, JS::Handle<JSObject*> aGivenProto) override;
|
||||
|
||||
// ScriptElement
|
||||
// nsScriptElement
|
||||
virtual bool HasScriptContent() override;
|
||||
};
|
||||
|
||||
|
@ -49,6 +49,7 @@
|
||||
#include "nsIDocShell.h"
|
||||
#include "nsNameSpaceManager.h"
|
||||
#include "nsError.h"
|
||||
#include "nsScriptLoader.h"
|
||||
#include "nsIPrincipal.h"
|
||||
#include "nsContainerFrame.h"
|
||||
#include "nsStyleUtil.h"
|
||||
@ -90,7 +91,6 @@
|
||||
#include "mozilla/dom/FromParser.h"
|
||||
#include "mozilla/dom/Link.h"
|
||||
#include "mozilla/BloomFilter.h"
|
||||
#include "mozilla/dom/ScriptLoader.h"
|
||||
|
||||
#include "nsVariant.h"
|
||||
#include "nsDOMTokenList.h"
|
||||
|
@ -19,10 +19,10 @@
|
||||
#include "nsIHTMLContentSink.h"
|
||||
#include "nsIInterfaceRequestor.h"
|
||||
#include "nsIInterfaceRequestorUtils.h"
|
||||
#include "nsScriptLoader.h"
|
||||
#include "nsIURI.h"
|
||||
#include "nsIContentViewer.h"
|
||||
#include "mozilla/dom/NodeInfo.h"
|
||||
#include "mozilla/dom/ScriptLoader.h"
|
||||
#include "nsToken.h"
|
||||
#include "nsIAppShell.h"
|
||||
#include "nsCRT.h"
|
||||
|
@ -16,7 +16,6 @@
|
||||
#include "mozilla/dom/MessagePortBinding.h"
|
||||
#include "mozilla/dom/MessagePortChild.h"
|
||||
#include "mozilla/dom/PMessagePort.h"
|
||||
#include "mozilla/dom/ScriptSettings.h"
|
||||
#include "mozilla/dom/StructuredCloneTags.h"
|
||||
#include "mozilla/dom/WorkerPrivate.h"
|
||||
#include "mozilla/dom/WorkerScope.h"
|
||||
@ -29,6 +28,7 @@
|
||||
#include "nsContentUtils.h"
|
||||
#include "nsGlobalWindow.h"
|
||||
#include "nsPresContext.h"
|
||||
#include "ScriptSettings.h"
|
||||
#include "SharedMessagePortMessage.h"
|
||||
|
||||
#include "nsIBFCacheEntry.h"
|
||||
|
@ -104,7 +104,6 @@ DIRS += [
|
||||
'webbrowserpersist',
|
||||
'xhr',
|
||||
'worklet',
|
||||
'script',
|
||||
]
|
||||
|
||||
if CONFIG['OS_ARCH'] == 'WINNT':
|
||||
|
@ -1,39 +0,0 @@
|
||||
# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
|
||||
# vim: set filetype=python:
|
||||
# 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/.
|
||||
|
||||
with Files("**"):
|
||||
BUG_COMPONENT = ("Core", "DOM")
|
||||
|
||||
XPIDL_SOURCES += [
|
||||
'nsIScriptLoaderObserver.idl',
|
||||
]
|
||||
|
||||
XPIDL_MODULE = 'dom'
|
||||
|
||||
EXPORTS += [
|
||||
'nsIScriptElement.h',
|
||||
]
|
||||
|
||||
EXPORTS.mozilla.dom += [
|
||||
'ScriptElement.h',
|
||||
'ScriptLoader.h',
|
||||
'ScriptSettings.h',
|
||||
]
|
||||
|
||||
UNIFIED_SOURCES += [
|
||||
'ScriptElement.cpp',
|
||||
'ScriptLoader.cpp',
|
||||
'ScriptSettings.cpp',
|
||||
]
|
||||
|
||||
LOCAL_INCLUDES += [
|
||||
'/dom/base',
|
||||
'/dom/workers',
|
||||
]
|
||||
|
||||
include('/ipc/chromium/chromium-config.mozbuild')
|
||||
|
||||
FINAL_LIBRARY = 'xul'
|
@ -43,7 +43,7 @@ NS_IMPL_ISUPPORTS_INHERITED(SVGScriptElement, SVGScriptElementBase,
|
||||
SVGScriptElement::SVGScriptElement(already_AddRefed<mozilla::dom::NodeInfo>& aNodeInfo,
|
||||
FromParser aFromParser)
|
||||
: SVGScriptElementBase(aNodeInfo)
|
||||
, ScriptElement(aFromParser)
|
||||
, nsScriptElement(aFromParser)
|
||||
{
|
||||
AddMutationObserver(this);
|
||||
}
|
||||
@ -190,7 +190,7 @@ SVGScriptElement::FreezeUriAsyncDefer()
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// ScriptElement methods
|
||||
// nsScriptElement methods
|
||||
|
||||
bool
|
||||
SVGScriptElement::HasScriptContent()
|
||||
|
@ -10,7 +10,7 @@
|
||||
#include "nsSVGElement.h"
|
||||
#include "nsCOMPtr.h"
|
||||
#include "nsSVGString.h"
|
||||
#include "mozilla/dom/ScriptElement.h"
|
||||
#include "nsScriptElement.h"
|
||||
|
||||
class nsIDocument;
|
||||
|
||||
@ -24,7 +24,7 @@ namespace dom {
|
||||
typedef nsSVGElement SVGScriptElementBase;
|
||||
|
||||
class SVGScriptElement final : public SVGScriptElementBase,
|
||||
public ScriptElement
|
||||
public nsScriptElement
|
||||
{
|
||||
protected:
|
||||
friend nsresult (::NS_NewSVGScriptElement(nsIContent **aResult,
|
||||
@ -47,7 +47,7 @@ public:
|
||||
virtual void FreezeUriAsyncDefer() override;
|
||||
virtual CORSMode GetCORSMode() const override;
|
||||
|
||||
// ScriptElement
|
||||
// nsScriptElement
|
||||
virtual bool HasScriptContent() override;
|
||||
|
||||
// nsIContent specializations:
|
||||
|
@ -34,6 +34,7 @@
|
||||
#include "nsIPipe.h"
|
||||
#include "nsIOutputStream.h"
|
||||
#include "nsPrintfCString.h"
|
||||
#include "nsScriptLoader.h"
|
||||
#include "nsString.h"
|
||||
#include "nsStreamUtils.h"
|
||||
#include "nsTArray.h"
|
||||
@ -57,7 +58,6 @@
|
||||
#include "mozilla/dom/Promise.h"
|
||||
#include "mozilla/dom/PromiseNativeHandler.h"
|
||||
#include "mozilla/dom/Response.h"
|
||||
#include "mozilla/dom/ScriptLoader.h"
|
||||
#include "mozilla/dom/ScriptSettings.h"
|
||||
#include "mozilla/dom/SRILogHelper.h"
|
||||
#include "mozilla/UniquePtr.h"
|
||||
@ -427,7 +427,7 @@ private:
|
||||
NS_IMPL_ISUPPORTS0(CacheCreator)
|
||||
|
||||
class CacheScriptLoader final : public PromiseNativeHandler
|
||||
, public nsIStreamLoaderObserver
|
||||
, public nsIStreamLoaderObserver
|
||||
{
|
||||
public:
|
||||
NS_DECL_ISUPPORTS
|
||||
@ -1078,14 +1078,14 @@ private:
|
||||
// May be null.
|
||||
nsIDocument* parentDoc = mWorkerPrivate->GetDocument();
|
||||
|
||||
// Use the regular ScriptLoader for this grunt work! Should be just fine
|
||||
// Use the regular nsScriptLoader for this grunt work! Should be just fine
|
||||
// because we're running on the main thread.
|
||||
// Unlike <script> tags, Worker scripts are always decoded as UTF-8,
|
||||
// per spec. So we explicitly pass in the charset hint.
|
||||
rv = ScriptLoader::ConvertToUTF16(aLoadInfo.mChannel, aString, aStringLen,
|
||||
NS_LITERAL_STRING("UTF-8"), parentDoc,
|
||||
aLoadInfo.mScriptTextBuf,
|
||||
aLoadInfo.mScriptTextLength);
|
||||
rv = nsScriptLoader::ConvertToUTF16(aLoadInfo.mChannel, aString, aStringLen,
|
||||
NS_LITERAL_STRING("UTF-8"), parentDoc,
|
||||
aLoadInfo.mScriptTextBuf,
|
||||
aLoadInfo.mScriptTextLength);
|
||||
if (NS_FAILED(rv)) {
|
||||
return rv;
|
||||
}
|
||||
@ -1212,10 +1212,10 @@ private:
|
||||
MOZ_ASSERT(!loadInfo.mScriptTextBuf);
|
||||
|
||||
nsresult rv =
|
||||
ScriptLoader::ConvertToUTF16(nullptr, aString, aStringLen,
|
||||
NS_LITERAL_STRING("UTF-8"), parentDoc,
|
||||
loadInfo.mScriptTextBuf,
|
||||
loadInfo.mScriptTextLength);
|
||||
nsScriptLoader::ConvertToUTF16(nullptr, aString, aStringLen,
|
||||
NS_LITERAL_STRING("UTF-8"), parentDoc,
|
||||
loadInfo.mScriptTextBuf,
|
||||
loadInfo.mScriptTextLength);
|
||||
if (NS_SUCCEEDED(rv) && IsMainWorkerScript()) {
|
||||
nsCOMPtr<nsIURI> finalURI;
|
||||
rv = NS_NewURI(getter_AddRefs(finalURI), loadInfo.mFullURL, nullptr, nullptr);
|
||||
|
@ -22,6 +22,7 @@
|
||||
#include "nsITimer.h"
|
||||
#include "nsIUploadChannel2.h"
|
||||
#include "nsPIDOMWindow.h"
|
||||
#include "nsScriptLoader.h"
|
||||
#include "nsServiceManagerUtils.h"
|
||||
#include "nsDebug.h"
|
||||
#include "nsISupportsPrimitives.h"
|
||||
@ -50,7 +51,6 @@
|
||||
#include "mozilla/ipc/BackgroundChild.h"
|
||||
#include "mozilla/ipc/PBackgroundChild.h"
|
||||
#include "mozilla/ipc/PBackgroundSharedTypes.h"
|
||||
#include "mozilla/dom/ScriptLoader.h"
|
||||
#include "mozilla/Unused.h"
|
||||
#include "mozilla/EnumSet.h"
|
||||
|
||||
|
@ -11,7 +11,6 @@
|
||||
#include "mozilla/dom/cache/Cache.h"
|
||||
#include "mozilla/dom/Promise.h"
|
||||
#include "mozilla/dom/PromiseWorkerProxy.h"
|
||||
#include "mozilla/dom/ScriptLoader.h"
|
||||
#include "mozilla/ipc/BackgroundUtils.h"
|
||||
#include "mozilla/ipc/PBackgroundSharedTypes.h"
|
||||
#include "nsICacheInfoChannel.h"
|
||||
@ -24,6 +23,7 @@
|
||||
#include "nsIScriptSecurityManager.h"
|
||||
#include "nsContentUtils.h"
|
||||
#include "nsNetUtil.h"
|
||||
#include "nsScriptLoader.h"
|
||||
#include "ServiceWorkerManager.h"
|
||||
#include "Workers.h"
|
||||
#include "nsStringStream.h"
|
||||
@ -828,9 +828,9 @@ CompareNetwork::OnStreamComplete(nsIStreamLoader* aLoader, nsISupports* aContext
|
||||
char16_t* buffer = nullptr;
|
||||
size_t len = 0;
|
||||
|
||||
rv = ScriptLoader::ConvertToUTF16(httpChannel, aString, aLen,
|
||||
NS_LITERAL_STRING("UTF-8"), nullptr,
|
||||
buffer, len);
|
||||
rv = nsScriptLoader::ConvertToUTF16(httpChannel, aString, aLen,
|
||||
NS_LITERAL_STRING("UTF-8"), nullptr,
|
||||
buffer, len);
|
||||
if (NS_WARN_IF(NS_FAILED(rv))) {
|
||||
mManager->NetworkFinished(rv);
|
||||
return rv;
|
||||
@ -882,9 +882,9 @@ CompareCache::OnStreamComplete(nsIStreamLoader* aLoader, nsISupports* aContext,
|
||||
char16_t* buffer = nullptr;
|
||||
size_t len = 0;
|
||||
|
||||
nsresult rv = ScriptLoader::ConvertToUTF16(nullptr, aString, aLen,
|
||||
NS_LITERAL_STRING("UTF-8"),
|
||||
nullptr, buffer, len);
|
||||
nsresult rv = nsScriptLoader::ConvertToUTF16(nullptr, aString, aLen,
|
||||
NS_LITERAL_STRING("UTF-8"),
|
||||
nullptr, buffer, len);
|
||||
if (NS_WARN_IF(NS_FAILED(rv))) {
|
||||
mManager->CacheFinished(rv, false);
|
||||
return rv;
|
||||
|
@ -15,9 +15,9 @@
|
||||
#include "mozilla/dom/RegisterWorkletBindings.h"
|
||||
#include "mozilla/dom/Response.h"
|
||||
#include "mozilla/dom/ScriptSettings.h"
|
||||
#include "mozilla/dom/ScriptLoader.h"
|
||||
#include "nsIThreadRetargetableRequest.h"
|
||||
#include "nsNetUtil.h"
|
||||
#include "nsScriptLoader.h"
|
||||
#include "xpcprivate.h"
|
||||
|
||||
namespace mozilla {
|
||||
@ -174,9 +174,9 @@ public:
|
||||
char16_t* scriptTextBuf;
|
||||
size_t scriptTextLength;
|
||||
nsresult rv =
|
||||
ScriptLoader::ConvertToUTF16(nullptr, aString, aStringLen,
|
||||
NS_LITERAL_STRING("UTF-8"), nullptr,
|
||||
scriptTextBuf, scriptTextLength);
|
||||
nsScriptLoader::ConvertToUTF16(nullptr, aString, aStringLen,
|
||||
NS_LITERAL_STRING("UTF-8"), nullptr,
|
||||
scriptTextBuf, scriptTextLength);
|
||||
if (NS_WARN_IF(NS_FAILED(rv))) {
|
||||
RejectPromises(rv);
|
||||
return NS_OK;
|
||||
|
@ -35,6 +35,7 @@
|
||||
#include "nsRect.h"
|
||||
#include "nsIWebNavigation.h"
|
||||
#include "nsIScriptElement.h"
|
||||
#include "nsScriptLoader.h"
|
||||
#include "nsStyleLinkElement.h"
|
||||
#include "nsReadableUtils.h"
|
||||
#include "nsUnicharUtils.h"
|
||||
@ -61,7 +62,6 @@
|
||||
#include "mozilla/dom/Element.h"
|
||||
#include "mozilla/dom/HTMLTemplateElement.h"
|
||||
#include "mozilla/dom/ProcessingInstruction.h"
|
||||
#include "mozilla/dom/ScriptLoader.h"
|
||||
|
||||
using namespace mozilla;
|
||||
using namespace mozilla::dom;
|
||||
|
@ -25,10 +25,10 @@
|
||||
#include "nsTArray.h"
|
||||
#include "nsCycleCollectionParticipant.h"
|
||||
#include "nsIDocShell.h"
|
||||
#include "nsScriptLoader.h"
|
||||
#include "mozilla/css/Loader.h"
|
||||
#include "mozilla/dom/DocumentFragment.h"
|
||||
#include "mozilla/dom/ProcessingInstruction.h"
|
||||
#include "mozilla/dom/ScriptLoader.h"
|
||||
|
||||
using namespace mozilla::dom;
|
||||
|
||||
|
@ -7,6 +7,7 @@
|
||||
|
||||
#include "nsIDocument.h"
|
||||
#include "nsIDocShell.h"
|
||||
#include "nsScriptLoader.h"
|
||||
#include "nsIDOMDocument.h"
|
||||
#include "nsIDOMDocumentType.h"
|
||||
#include "nsIScriptElement.h"
|
||||
@ -30,7 +31,6 @@
|
||||
#include "mozilla/css/Loader.h"
|
||||
#include "mozilla/dom/Element.h"
|
||||
#include "mozilla/dom/EncodingUtils.h"
|
||||
#include "mozilla/dom/ScriptLoader.h"
|
||||
#include "nsContentUtils.h"
|
||||
#include "txXMLUtils.h"
|
||||
#include "nsContentSink.h"
|
||||
@ -230,7 +230,7 @@ txMozillaXMLOutput::endDocument(nsresult aResult)
|
||||
MOZ_ASSERT(mDocument->GetReadyStateEnum() ==
|
||||
nsIDocument::READYSTATE_LOADING, "Bad readyState");
|
||||
mDocument->SetReadyStateInternal(nsIDocument::READYSTATE_INTERACTIVE);
|
||||
ScriptLoader* loader = mDocument->ScriptLoader();
|
||||
nsScriptLoader* loader = mDocument->ScriptLoader();
|
||||
if (loader) {
|
||||
loader->ParsingComplete(false);
|
||||
}
|
||||
@ -419,7 +419,7 @@ txMozillaXMLOutput::startDocument()
|
||||
}
|
||||
|
||||
if (mCreatingNewDocument) {
|
||||
ScriptLoader* loader = mDocument->ScriptLoader();
|
||||
nsScriptLoader* loader = mDocument->ScriptLoader();
|
||||
if (loader) {
|
||||
loader->BeginDeferringScripts();
|
||||
}
|
||||
@ -860,7 +860,7 @@ txMozillaXMLOutput::createResultDocument(const nsSubstring& aName, int32_t aNsID
|
||||
}
|
||||
|
||||
// Set up script loader of the result document.
|
||||
ScriptLoader *loader = mDocument->ScriptLoader();
|
||||
nsScriptLoader *loader = mDocument->ScriptLoader();
|
||||
if (mNotifier) {
|
||||
loader->AddObserver(mNotifier);
|
||||
}
|
||||
|
@ -3344,10 +3344,10 @@ XULDocument::OnStreamComplete(nsIStreamLoader* aLoader,
|
||||
!mOffThreadCompileStringBuf),
|
||||
"XULDocument can't load multiple scripts at once");
|
||||
|
||||
rv = ScriptLoader::ConvertToUTF16(channel, string, stringLen,
|
||||
EmptyString(), this,
|
||||
mOffThreadCompileStringBuf,
|
||||
mOffThreadCompileStringLength);
|
||||
rv = nsScriptLoader::ConvertToUTF16(channel, string, stringLen,
|
||||
EmptyString(), this,
|
||||
mOffThreadCompileStringBuf,
|
||||
mOffThreadCompileStringLength);
|
||||
if (NS_SUCCEEDED(rv)) {
|
||||
// Attempt to give ownership of the buffer to the JS engine. If
|
||||
// we hit offthread compilation, however, we will have to take it
|
||||
|
@ -21,13 +21,13 @@
|
||||
#include "nsCOMArray.h"
|
||||
#include "nsIURI.h"
|
||||
#include "nsIXULDocument.h"
|
||||
#include "nsScriptLoader.h"
|
||||
#include "nsIStreamListener.h"
|
||||
#include "nsIStreamLoader.h"
|
||||
#include "nsICSSLoaderObserver.h"
|
||||
#include "nsIXULStore.h"
|
||||
|
||||
#include "mozilla/Attributes.h"
|
||||
#include "mozilla/dom/ScriptLoader.h"
|
||||
|
||||
#include "js/TracingAPI.h"
|
||||
#include "js/TypeDecls.h"
|
||||
|
@ -879,7 +879,7 @@ XULContentSinkImpl::OpenScript(const char16_t** aAttributes,
|
||||
isJavaScript = false;
|
||||
}
|
||||
} else if (key.EqualsLiteral("language")) {
|
||||
// Language is deprecated, and the impl in ScriptLoader ignores the
|
||||
// Language is deprecated, and the impl in nsScriptLoader ignores the
|
||||
// various version strings anyway. So we make no attempt to support
|
||||
// languages other than JS for language=
|
||||
nsAutoString lang(aAttributes[1]);
|
||||
|
@ -9,6 +9,7 @@
|
||||
#include "nsIURI.h"
|
||||
#include "nsIChannel.h"
|
||||
#include "nsNetUtil.h"
|
||||
#include "nsScriptLoader.h"
|
||||
#include "nsThreadUtils.h"
|
||||
|
||||
#include "jsapi.h"
|
||||
@ -17,7 +18,6 @@
|
||||
|
||||
#include "mozilla/dom/ChromeUtils.h"
|
||||
#include "mozilla/dom/Promise.h"
|
||||
#include "mozilla/dom/ScriptLoader.h"
|
||||
#include "mozilla/HoldDropJSObjects.h"
|
||||
#include "mozilla/SystemGroup.h"
|
||||
#include "nsCycleCollectionParticipant.h"
|
||||
@ -241,7 +241,7 @@ AsyncScriptCompiler::OnStreamComplete(nsIIncrementalStreamLoader* aLoader,
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
nsresult rv = ScriptLoader::ConvertToUTF16(
|
||||
nsresult rv = nsScriptLoader::ConvertToUTF16(
|
||||
nullptr, aBuf, aLength, mCharset, nullptr, mScriptText, mScriptLength);
|
||||
if (NS_FAILED(rv)) {
|
||||
Reject(cx, "Unable to decode script");
|
||||
|
@ -15,6 +15,7 @@
|
||||
#include "nsNetCID.h"
|
||||
#include "nsNetUtil.h"
|
||||
#include "nsIFileURL.h"
|
||||
#include "nsScriptLoader.h"
|
||||
#include "nsIScriptSecurityManager.h"
|
||||
#include "nsThreadUtils.h"
|
||||
|
||||
@ -26,7 +27,6 @@
|
||||
|
||||
#include "mozilla/dom/Promise.h"
|
||||
#include "mozilla/dom/ToJSValue.h"
|
||||
#include "mozilla/dom/ScriptLoader.h"
|
||||
#include "mozilla/HoldDropJSObjects.h"
|
||||
#include "mozilla/ScriptPreloader.h"
|
||||
#include "mozilla/scache/StartupCache.h"
|
||||
@ -148,8 +148,8 @@ PrepareScript(nsIURI* uri,
|
||||
size_t scriptLength = 0;
|
||||
|
||||
nsresult rv =
|
||||
ScriptLoader::ConvertToUTF16(nullptr, reinterpret_cast<const uint8_t*>(buf), len,
|
||||
charset, nullptr, scriptBuf, scriptLength);
|
||||
nsScriptLoader::ConvertToUTF16(nullptr, reinterpret_cast<const uint8_t*>(buf), len,
|
||||
charset, nullptr, scriptBuf, scriptLength);
|
||||
|
||||
JS::SourceBufferHolder srcBuf(scriptBuf, scriptLength,
|
||||
JS::SourceBufferHolder::GiveOwnership);
|
||||
@ -858,9 +858,9 @@ ScriptPrecompiler::OnStreamComplete(nsIIncrementalStreamLoader* aLoader,
|
||||
// Convert data to char16_t* and prepare to call CompileOffThread.
|
||||
nsAutoString hintCharset;
|
||||
nsresult rv =
|
||||
ScriptLoader::ConvertToUTF16(mChannel, aString, aLength,
|
||||
hintCharset, nullptr,
|
||||
mScriptBuf, mScriptLength);
|
||||
nsScriptLoader::ConvertToUTF16(mChannel, aString, aLength,
|
||||
hintCharset, nullptr,
|
||||
mScriptBuf, mScriptLength);
|
||||
|
||||
NS_ENSURE_SUCCESS(rv, NS_OK);
|
||||
|
||||
|
@ -37,13 +37,13 @@
|
||||
#include "nsCCUncollectableMarker.h"
|
||||
#include "nsCycleCollectionNoteRootCallback.h"
|
||||
#include "nsCycleCollector.h"
|
||||
#include "nsScriptLoader.h"
|
||||
#include "jsapi.h"
|
||||
#include "jsprf.h"
|
||||
#include "js/MemoryMetrics.h"
|
||||
#include "mozilla/dom/GeneratedAtomList.h"
|
||||
#include "mozilla/dom/BindingUtils.h"
|
||||
#include "mozilla/dom/Element.h"
|
||||
#include "mozilla/dom/ScriptLoader.h"
|
||||
#include "mozilla/dom/WindowBinding.h"
|
||||
#include "mozilla/jsipc/CrossProcessObjectWrappers.h"
|
||||
#include "mozilla/Atomics.h"
|
||||
|
@ -30,13 +30,13 @@
|
||||
#include "mozilla/Preferences.h"
|
||||
#include "mozilla/Telemetry.h"
|
||||
#include "mozilla/Services.h"
|
||||
#include "mozilla/dom/ScriptLoader.h"
|
||||
#include "mozilla/dom/ScriptSettings.h"
|
||||
|
||||
#include "nsContentUtils.h"
|
||||
#include "nsCCUncollectableMarker.h"
|
||||
#include "nsCycleCollectionNoteRootCallback.h"
|
||||
#include "nsCycleCollector.h"
|
||||
#include "nsScriptLoader.h"
|
||||
#include "jsapi.h"
|
||||
#include "jsprf.h"
|
||||
#include "js/MemoryMetrics.h"
|
||||
@ -2891,8 +2891,8 @@ ReadSourceFromFilename(JSContext* cx, const char* filename, char16_t** src, size
|
||||
ptr += bytesRead;
|
||||
}
|
||||
|
||||
rv = ScriptLoader::ConvertToUTF16(scriptChannel, buf.get(), rawLen,
|
||||
EmptyString(), nullptr, *src, *len);
|
||||
rv = nsScriptLoader::ConvertToUTF16(scriptChannel, buf.get(), rawLen, EmptyString(),
|
||||
nullptr, *src, *len);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
if (!*src)
|
||||
|
@ -8,9 +8,9 @@
|
||||
|
||||
#include "nsIStyleSheetLinkingElement.h"
|
||||
#include "nsStyleLinkElement.h"
|
||||
#include "nsScriptLoader.h"
|
||||
#include "nsIHTMLDocument.h"
|
||||
#include "nsNameSpaceManager.h"
|
||||
#include "mozilla/dom/ScriptLoader.h"
|
||||
|
||||
NS_IMPL_CYCLE_COLLECTION_INHERITED(nsHtml5DocumentBuilder, nsContentSink,
|
||||
mOwnedElements)
|
||||
|
@ -6,8 +6,8 @@
|
||||
|
||||
#include "nsHtml5OplessBuilder.h"
|
||||
|
||||
#include "nsScriptLoader.h"
|
||||
#include "mozilla/css/Loader.h"
|
||||
#include "mozilla/dom/ScriptLoader.h"
|
||||
#include "nsIDocShell.h"
|
||||
#include "nsIHTMLDocument.h"
|
||||
|
||||
|
@ -7,10 +7,10 @@
|
||||
#include "mozilla/DebugOnly.h"
|
||||
#include "mozilla/Likely.h"
|
||||
#include "mozilla/dom/nsCSPService.h"
|
||||
#include "mozilla/dom/ScriptLoader.h"
|
||||
|
||||
#include "nsError.h"
|
||||
#include "nsHtml5TreeOpExecutor.h"
|
||||
#include "nsScriptLoader.h"
|
||||
#include "nsIContentViewer.h"
|
||||
#include "nsIContentSecurityPolicy.h"
|
||||
#include "nsIDocShellTreeItem.h"
|
||||
@ -953,8 +953,8 @@ nsHtml5TreeOpExecutor::PreloadScript(const nsAString& aURL,
|
||||
return;
|
||||
}
|
||||
mDocument->ScriptLoader()->PreloadURI(uri, aCharset, aType, aCrossOrigin,
|
||||
aIntegrity, aScriptFromHead,
|
||||
mSpeculationReferrerPolicy);
|
||||
aIntegrity, aScriptFromHead,
|
||||
mSpeculationReferrerPolicy);
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -9,6 +9,7 @@
|
||||
#include "nsXPCOM.h"
|
||||
#include "nsISupportsPrimitives.h"
|
||||
#include "nsXPIDLString.h"
|
||||
#include "nsScriptLoader.h"
|
||||
#include "nsEscape.h"
|
||||
#include "nsIParser.h"
|
||||
#include "nsIDTD.h"
|
||||
@ -35,7 +36,6 @@
|
||||
#include "nsTreeSanitizer.h"
|
||||
#include "nsHtml5Module.h"
|
||||
#include "mozilla/dom/DocumentFragment.h"
|
||||
#include "mozilla/dom/ScriptLoader.h"
|
||||
#include "NullPrincipal.h"
|
||||
|
||||
#define XHTML_DIV_TAG "div xmlns=\"http://www.w3.org/1999/xhtml\""
|
||||
@ -148,7 +148,7 @@ nsParserUtils::ParseFragment(const nsAString& aFragment,
|
||||
nsAutoScriptBlockerSuppressNodeRemoved autoBlocker;
|
||||
|
||||
// stop scripts
|
||||
RefPtr<ScriptLoader> loader;
|
||||
RefPtr<nsScriptLoader> loader;
|
||||
bool scripts_enabled = false;
|
||||
if (document) {
|
||||
loader = document->ScriptLoader();
|
||||
|
@ -28,6 +28,7 @@
|
||||
#include "nsIFragmentContentSink.h"
|
||||
#include "nsStreamUtils.h"
|
||||
#include "nsHTMLTokenizer.h"
|
||||
#include "nsScriptLoader.h"
|
||||
#include "nsDataHashtable.h"
|
||||
#include "nsXPCOMCIDInternal.h"
|
||||
#include "nsMimeTypes.h"
|
||||
@ -39,7 +40,6 @@
|
||||
#include "nsIHTMLContentSink.h"
|
||||
|
||||
#include "mozilla/dom/EncodingUtils.h"
|
||||
#include "mozilla/dom/ScriptLoader.h"
|
||||
#include "mozilla/BinarySearch.h"
|
||||
|
||||
using namespace mozilla;
|
||||
|
Loading…
x
Reference in New Issue
Block a user