summaryrefslogtreecommitdiffstats
path: root/dom/script/ScriptLoader.h
diff options
context:
space:
mode:
authorMoonchild <moonchild@palemoon.org>2020-07-01 10:15:24 +0000
committerMoonchild <moonchild@palemoon.org>2020-07-10 18:29:02 +0000
commit5ffe27bb03d8ac7b979007721c2699e891c77268 (patch)
tree433a153c67bb17f4455c76d2bb8a9787c9330890 /dom/script/ScriptLoader.h
parent0633844f46858135ee62d396829c6292492ca117 (diff)
downloadUXP-5ffe27bb03d8ac7b979007721c2699e891c77268.tar
UXP-5ffe27bb03d8ac7b979007721c2699e891c77268.tar.gz
UXP-5ffe27bb03d8ac7b979007721c2699e891c77268.tar.lz
UXP-5ffe27bb03d8ac7b979007721c2699e891c77268.tar.xz
UXP-5ffe27bb03d8ac7b979007721c2699e891c77268.zip
Issue #1603 - Part 2: Split some classes out of ScriptLoader.cpp
This splits ScriptLoader up the same way Mozilla did with the exception of ScriptRequest due to the fact that ScriptLoader and ScriptRequest are interdependent and would create a circular dependency if split apart when not using unified building.
Diffstat (limited to 'dom/script/ScriptLoader.h')
-rw-r--r--dom/script/ScriptLoader.h53
1 files changed, 1 insertions, 52 deletions
diff --git a/dom/script/ScriptLoader.h b/dom/script/ScriptLoader.h
index 6fe76eca8..3c428deea 100644
--- a/dom/script/ScriptLoader.h
+++ b/dom/script/ScriptLoader.h
@@ -4,10 +4,6 @@
* 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/. */
-/*
- * A class that handles loading and evaluation of <script> elements.
- */
-
#ifndef mozilla_dom_ScriptLoader_h
#define mozilla_dom_ScriptLoader_h
@@ -25,7 +21,6 @@
#include "mozilla/CORSMode.h"
#include "mozilla/dom/SRIMetadata.h"
#include "mozilla/dom/SRICheck.h"
-#include "mozilla/LinkedList.h"
#include "mozilla/MozPromise.h"
#include "mozilla/net/ReferrerPolicy.h"
#include "mozilla/Vector.h"
@@ -221,6 +216,7 @@ public:
NS_RELEASE(aElem);
}
};
+class ScriptLoadHandler;
//////////////////////////////////////////////////////////////
// Script loader implementation
@@ -643,53 +639,6 @@ private:
nsCOMPtr<nsIConsoleReportCollector> mReporter;
};
-class ScriptLoadHandler final : public nsIIncrementalStreamLoaderObserver
-{
-public:
- explicit ScriptLoadHandler(ScriptLoader* aScriptLoader,
- ScriptLoadRequest *aRequest,
- mozilla::dom::SRICheckDataVerifier *aSRIDataVerifier);
-
- NS_DECL_ISUPPORTS
- NS_DECL_NSIINCREMENTALSTREAMLOADEROBSERVER
-
-private:
- virtual ~ScriptLoadHandler();
-
- /*
- * Try to decode some raw data.
- */
- nsresult TryDecodeRawData(const uint8_t* aData, uint32_t aDataLength,
- bool aEndOfStream);
-
- /*
- * Discover the charset by looking at the stream data, the script
- * tag, and other indicators. Returns true if charset has been
- * discovered.
- */
- bool EnsureDecoder(nsIIncrementalStreamLoader *aLoader,
- const uint8_t* aData, uint32_t aDataLength,
- bool aEndOfStream);
-
- // ScriptLoader which will handle the parsed script.
- RefPtr<ScriptLoader> mScriptLoader;
-
- // The ScriptLoadRequest for this load.
- RefPtr<ScriptLoadRequest> mRequest;
-
- // SRI data verifier.
- nsAutoPtr<mozilla::dom::SRICheckDataVerifier> mSRIDataVerifier;
-
- // Status of SRI data operations.
- nsresult mSRIStatus;
-
- // Unicode decoder for charset.
- nsCOMPtr<nsIUnicodeDecoder> mDecoder;
-
- // Accumulated decoded char buffer.
- mozilla::Vector<char16_t> mBuffer;
-};
-
class nsAutoScriptLoaderDisabler
{
public: