Bug 1742438 - Part 8: Use mScriptData instead of custom load context field; r=arai,asuth
This is the most substantial change in the transition from ScriptLoadInfo to ScriptLoadRequest with regards to data representation. ScriptLoadRequests can have their data incrementally loaded, so it is already fully decoded and ready to go by the time that we create the source buffer for worker scripts. This simplifies some of the code, and we can add incremental loading when we are ready. Differential Revision: https://phabricator.services.mozilla.com/D146180
This commit is contained in:
@@ -229,11 +229,13 @@ class ScriptLoadRequest
|
||||
mDataType = DataType::eUnknown;
|
||||
mScriptData.reset();
|
||||
}
|
||||
|
||||
bool IsUTF8ParsingEnabled();
|
||||
|
||||
void SetTextSource() {
|
||||
MOZ_ASSERT(IsUnknownDataType());
|
||||
mDataType = DataType::eTextSource;
|
||||
if (mozilla::StaticPrefs::
|
||||
dom_script_loader_external_scripts_utf8_parsing_enabled()) {
|
||||
if (IsUTF8ParsingEnabled()) {
|
||||
mScriptData.emplace(VariantType<ScriptTextBuffer<Utf8Unit>>());
|
||||
} else {
|
||||
mScriptData.emplace(VariantType<ScriptTextBuffer<char16_t>>());
|
||||
|
||||
Reference in New Issue
Block a user