Bug 1757833 - Extract methods ScriptBytecodeCompress and ScriptBytecodeDecompress r=nbp
This leaves the code in ScriptLoader and ScriptLoadHandler a lot more readable. ScriptBytecodeCompressedDataLayout and ScriptBytecodeDataLayout simplify locating data in the ScriptLoadRequest bytecode buffer when compressing and decompressing it. The interface is still error-prone. For example, these classes don't check that the returned pointers are within the bounds of the buffer. Differential Revision: https://phabricator.services.mozilla.com/D145011
This commit is contained in:
@@ -325,7 +325,8 @@ class ScriptLoadRequest
|
||||
size_t mScriptTextLength;
|
||||
|
||||
// Holds the SRI serialized hash and the script bytecode for non-inline
|
||||
// scripts.
|
||||
// scripts. The data is laid out according to ScriptBytecodeDataLayout
|
||||
// or, if compression is enabled, ScriptBytecodeCompressedDataLayout.
|
||||
mozilla::Vector<uint8_t> mScriptBytecode;
|
||||
uint32_t mBytecodeOffset; // Offset of the bytecode in mScriptBytecode
|
||||
|
||||
|
||||
Reference in New Issue
Block a user