Closed Bug 1394442 Opened 7 years ago Closed 7 years ago

Clear the Transcode buffer after decoding.

Categories

(Core :: DOM: Core & HTML, enhancement)

enhancement
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla57
Tracking Status
firefox57 --- fixed

People

(Reporter: nbp, Assigned: nbp)

References

Details

Attachments

(1 file)

At the moment, the bytecode buffer are kept alive after the evaluation as long as the script load request is alive. This is likely to be the issue reported in Bug 900784 comment 130. We have multiple option, we can: 1. Clear the bytecode buffer where the source buffer is cleared, after the call to EvaluateScript. 2. Move the bytecode buffer into the decoder function, having for side-effect of clearing the original buffer. 3. Clear the bytecode buffer in the decoder.
This patch implement the option 1 of comment 0, i-e to clear the bytecode buffer after the end of the EvaluateScript function call, where we are already cleaning the source. The check for IsBytecode is used to ensure that we were decoding, and never encoding. Thus keeping the SRI bits in the buffer if we might want to encode the script bytecode later.
Attachment #8901860 - Flags: review?(mrbkap)
Attachment #8901860 - Flags: review?(mrbkap) → review+
Testing on Try, attachment 8901860 [details] [diff] [review] does not seems to fix the issue reported in Bug 900784 comment 130.
Pushed by npierron@mozilla.com: https://hg.mozilla.org/integration/mozilla-inbound/rev/33a50b654311 Clear the bytecode buffer after the evaluation. r=mrbkap
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla57
Component: DOM → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: