Replace mScriptTextBug and mScriptTextLEngth of the nsScriptLoadRequest by an
equivalent Vector.
Also remove the aString argument from the nsScriptLoader::PrepareLoadedRequest
and nsScriptLoader::OnStreamComplete, as the nsScriptLoadHandler is now writing
to the Vector held by the nsScriptLoadRequest.
Doing so is needed to avoid adding more arguments to OnStreamComplete, as we are
going to add the bytecode cache input in a similar way as the text input.
Moving aScriptFromHead to a field of the ScriptLoadRequest ensure that all the
state to call StartLoad is either in the ScriptLoader or in the
ScriptLoadRequest.
Thus, we can later add new calls to StartLoad, if we have to restart a request
because of some decoding issues.
In order to be able to put timeouts in the correct bucket as soon as
they are scheduled, we need to be able to synchronously tell whether a
timeout is coming from a script that is on the tracking protection list.
But the URL Classifier API which we use for this task is asynchronous.
Because of this, and to avoid unnecessary IPC from the content to the
parent process every time we need to know where a script came from, we
cache this information in nsIDocument. The hash table mTrackingScripts
will have one entry per script loaded in the document which is on the
tracking protection list.
For performance reasons, we coalesce querying whether a script source
URL is on the tracking protection list with the load of the script from
the network. In most cases we'll have the response from the URL
Classifier service before the script load is finished, but on the off
chance that the load finishes first, we wait before finishing the script
load to get the response from the URL Classifier service.
These GC things can be passed to the JS engine, so we should make sure
they are not marked gray.
MozReview-Commit-ID: GJDogXSuqYh
--HG--
extra : rebase_source : a9231a81c2791f1da6918595e2d6329f7ba14e79
If we have a creator parser, then we were a parser-inserted script and should
presumably be able to set a valid insertion point when we run or fire our
load/error events. For the error event case, we do this in
nsScriptElement::ScriptAvailable, so that async error events due to things like
bogus script URLs do not end up with a valid insertion point. For the load
event case, we just do this in ScriptEvaluated directly.
ScriptEvaluated is called while the scriptloader has our script set as the
current parser-inserted script. But for the error event case we need to
maintain that state around the ScriptAvailable call that will fire the event.
The patch is generated from following command:
rgrep -l unused.h|xargs sed -i -e s,mozilla/unused.h,mozilla/Unused.h,
MozReview-Commit-ID: AtLcWApZfES
--HG--
rename : mfbt/unused.h => mfbt/Unused.h
This makes a lot of code more compact, and also avoids some redundant nsresult
checks.
The patch also removes a handful of redundant checks on infallible setters.
--HG--
extra : rebase_source : f82426e7584d0d5cddf7c2524356f0f318fbea7d
This patch makes most Run() declarations in subclasses of nsIRunnable have the
same form: |NS_IMETHOD Run() override|.
As a result of these changes, I had to add |override| to a couple of other
functions to satisfy clang's -Winconsistent-missing-override warning.
--HG--
extra : rebase_source : 815d0018b0b13329bb5698c410f500dddcc3ee12