Commit Graph

126 Commits

Author SHA1 Message Date
Ehsan Akhgari
3cade99c10 Bug 1321868 - Add an API to nsIDocument to determine whether a script is on the tracking protection list; r=bkelly
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.
2016-12-02 15:37:11 -05:00
Bill McCloskey
0331382a72 Bug 1318506 - Assign DocGroup for ScriptLoader runnable (r=ehsan)
MozReview-Commit-ID: G8nQdpq11bR
2016-12-01 15:00:13 -08:00
Bill McCloskey
2336b52695 Bug 1318506 - Label some common runnables with a DocGroup (r=ehsan)
MozReview-Commit-ID: 19gyZRfbzXP
2016-12-01 15:00:13 -08:00
Sebastian Hengst
bc90f7a8c9 Backed out changeset ee28526a9033 (bug 1318506) for frequent failure in clearkey-mp4-setmediakeys-multiple-times-with-the-same-mediakeys.html. r=backout 2016-12-01 13:36:31 +01:00
Sebastian Hengst
fc5cc275d5 Backed out changeset bb19a439bfbd (bug 1318506) 2016-12-01 13:35:11 +01:00
Bill McCloskey
4f5758d3cf Bug 1318506 - Assign DocGroup for ScriptLoader runnable (r=ehsan)
MozReview-Commit-ID: G8nQdpq11bR
2016-11-30 18:01:59 -08:00
Bill McCloskey
4143046195 Bug 1318506 - Label some common runnables with a DocGroup (r=ehsan)
MozReview-Commit-ID: 19gyZRfbzXP
2016-11-30 18:01:59 -08:00
Christoph Kerschbaumer
c267f70f91 Bug 1299483 - CSP: Implement 'strict-dynamic', enforcement changes. r=dveditz,freddyb 2016-11-08 12:55:23 +01:00
Jon Coppeard
556585c65f Bug 1297558 - Remove explicit calls to Expose*ToActiveJS r=mccr8 2016-10-18 17:58:19 +01:00
Andrea Marchesini
0563a867cb Bug 1299686 - Fix crash in nsScriptLoader.cpp. r=smaug
--HG--
extra : rebase_source : 9ba5328cd6d907dec2a4c95b5d557cad0317e44e
2016-09-22 16:58:46 -04:00
Boris Zbarsky
ca48a2a2c0 Bug 1303397. nsScriptLoader should just use nsContentUtils::CheckForBOM instead of rolling its own copy. r=bkelly 2016-09-20 13:24:06 +01:00
Andrea Marchesini
5994c71158 Bug 1301251 - Handle GetSpec() failure in nsContentUtils::GetWrapperSafeScriptFilename(), r=smaug 2016-09-19 15:50:22 +02:00
Andi-Bogdan Postelnicu
8f2af4af11 Bug 1302658 - substitute null checks with NS_ENSURE_TRUE. r=baku
MozReview-Commit-ID: GQmfWrmhKNg

--HG--
extra : rebase_source : 50c8dbac10a8b249bccce27616159daec9d9af1a
2016-09-14 12:15:01 +03:00
Andi-Bogdan Postelnicu
3fb6fb25a2 Bug 1302109 - if mDocument is null return from PreloadURI. r=baku
MozReview-Commit-ID: FoSVrK9PT3s

--HG--
extra : rebase_source : 5ce2721bb02d4277008ee97ac4e102f6301ac198
2016-09-12 17:22:15 +03:00
Andrew McCreight
85213c72b0 Bug 1301189 - Use ExposeObjectToActiveJS in nsModuleScript. r=smaug
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
2016-09-07 14:39:34 -07:00
Tom Tung
db38e2111a Bug 1187335 - P6 - Support script/css to set integrity metadata to serviceWorker. r=bkelly. r=francois. 2016-09-07 10:30:21 +08:00
Tom Tung
78670a91d5 Bug 1187335 - P2 - Modify the way to report to console for worker and use LoadTainting to decide CORS or not. r=bkelly. r=francois. 2016-09-08 09:59:40 +08:00
Boris Zbarsky
363a5143aa Bug 1297125. Make sure the parser insertion point is defined when firing the load event for external <scripts> or firing the error event on a failed external script load (but not other cases, like bogus script URL). r=hsivonen
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.
2016-09-02 17:55:38 -04:00
Henri Sivonen
85403ede23 Bug 619109 - Define the insertion point before and undefine after the synchronous script execution events. r=bzbarsky.
MozReview-Commit-ID: FAriD6I2m2L
2010-10-29 12:22:10 +03:00
Michael Layzell
b258dfaa89 Bug 1297802 - Remove unused RefPtr<> and COMPtr<> types in dom/, r=baku
MozReview-Commit-ID: CLUJZdbN7sW
2016-08-29 11:40:02 -04:00
Jon Coppeard
2317b2fef5 Bug 1295978 - Eagerly instantiate module dependencies r=bkelly 2016-08-26 11:09:52 +01:00
Kan-Ru Chen
b6d880aca1 Bug 1297276 - Rename mfbt/unused.h to mfbt/Unused.h for consistency. r=froydnj
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
2016-08-24 14:47:04 +08:00
Jon Coppeard
5b24ece193 Bug 1292614 - Set introductionType correctly for imported modules r=smaug
--HG--
extra : rebase_source : 2e6fc7a12929bb551178878d6797acc8fbfed7d7
2016-08-18 10:26:16 +01:00
Nicholas Nethercote
ca40b738e4 Bug 1294620 - Use infallible XPIDL attribute getters more. r=erahm.
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
2016-08-12 15:19:29 +10:00
Jan de Mooij
0ad12515f4 Bug 1292892 part 1 - Stop using JSRuntime outside SpiderMonkey. r=bz,terrence,fitzgen,kanru 2016-08-11 14:39:22 +02:00
Nicholas Nethercote
e7f10a07fd Bug 1293603 (part 2) - Make Run() declarations consistent. r=erahm.
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
2016-08-08 12:18:10 +10:00
Ben Kelly
b8e8e264e4 Bug 1287547 Don't leak HTMLScriptElement wrapper when page is closed during off-thread script parsing. r=bz 2016-07-25 15:16:58 -07:00
Decky Coss
930377928e Bug 1286321 - always ignore language attribute when processing script element if type attribute is defined. r=bz
MozReview-Commit-ID: AQV9mkYzLL2

--HG--
extra : transplant_source : %92%96%BC2%0C%CA%C1%14%F4%A4%18B%0E%D5%28%A5NI%15T
2016-07-13 12:10:13 -04:00
Jan de Mooij
0f65c9be84 Bug 1286159 - Clean up FinishOffThread* APIs for off-thread parsing. r=jonco 2016-07-19 09:19:54 +02:00
Jon Coppeard
ed839a5b59 Bug 1281194 - Don't use for-of iteration over requested modules array r=bz 2016-06-23 11:52:51 +01:00
Boris Zbarsky
2a3c63b8e7 Bug 1281366. Ensure that when unblocking the scriptloader we try to process scripts if we have _any_ scripts to process, not just parser-blocking ones. r=smaug 2016-06-23 00:22:29 -04:00
Christoph Kerschbaumer
19ac7d31c1 Bug 1274170 - Remove unnecessary includes of nsCorsListenerProxy. r=jkingston
--HG--
extra : rebase_source : 488864e497a7e6c127a98e05efd17d1d0580e000
2016-06-21 12:54:03 +02:00
Nathan Froyd
150bcb573b Bug 1278925 - micro-optimize nsCOMArray appending with already_AddRefed AppendElement; r=erahm
In all of the places touched by this patch, the smart pointer we're
appending is about to become unused, so simply .forget()'ing its
reference into the appropriate nsCOMArray works just fine.
2016-06-20 18:38:10 -04:00
Bob Owen
7c3321c672 Bug 1277475 Part 1: Add a chrome and XBL accessor for the sandboxed scripts flag to Document WEBIDL. r=bz
This also incldues changes to use the new function instead of getting and checking the sandbox flags in most places.

MozReview-Commit-ID: Cv0vJCdLH4D
2016-06-09 11:22:22 +01:00
Nathan Froyd
1dd7bdbf29 Bug 1277429 - remove unused variable in ResolveRequestedModules; r=baku 2016-06-03 18:31:58 -04:00
Boris Zbarsky
43a4676066 Bug 1276276 part 2. Change AutoEntryScript to always use the safe jscontext instead of trying to find a global-specific one. r=smaug 2016-06-02 10:34:39 -04:00
Frederik Braun
404a0bbb99 Bug 1265318: add require-sri-for CSP directive. r=ckerschb
MozReview-Commit-ID: 200PAvKtBME
2016-05-31 11:14:00 +02:00
Boris Zbarsky
7d23da273d Bug 1276309 part 1. Stop depending on the exact value of nsIScriptContext::GetNativeContext in the scriptloader. r=bkelly 2016-05-27 20:26:56 -04:00
Boris Zbarsky
bd7589ca0a Bug 1267989 part 2. Add nsScriptLoader::Add/RemoveExecuteBlocker which in fact block script execution on that script loader. r=smaug
Unlike the parser-blocking thing, we don't need to block parents or anything; all consumers of this API will be walking the frame tree anyway.
2016-05-20 23:13:18 -04:00
Boris Zbarsky
3c447f1d99 Bug 1267989 part 1. Rename nsScriptLoader::Add/RemoveExecuteBlocker to Add/RemoveParserBlockingScriptBlocker, to more clearly reflect what it does. r=smaug 2016-05-20 23:13:18 -04:00
Jon Coppeard
8d7ea09706 Bug 1240072 - Implement <script type="module"> for chrome pages only r=sicking 2016-05-07 12:46:38 +01:00
Christoph Kerschbaumer
efc3c94b66 Bug 1268147 - Remove nsScriptLoader::ShouldLoadScript (r=sicking) 2016-05-06 15:31:48 +02:00
Kyle Huey
941ab1f522 Bug 1268313: Part 7 - Move NS_NewRunnableMethod and friends to mozilla::NewRunnableMethod. r=froydnj 2016-05-05 01:45:00 -07:00
Andreas Farre
51e42c28d2 Bug 1268851 - Add SRILogHelper to hold GetSriLog r=baku
MozReview-Commit-ID: BqW7LXOFirn

--HG--
extra : rebase_source : cf0d1c8f1f88e05912830cef673e866b7c2756c4
2016-05-03 17:43:33 -07:00
Carsten "Tomcat" Book
ba3fe0975c Backed out changeset 85ce8cb0639a (bug 1268313)
--HG--
extra : rebase_source : 56d1cf41a2dc4959b67f834e07192a5c772176a8
2016-04-29 14:21:16 +02:00
Kyle Huey
48a594a09e Bug 1268313: Part 7 - Move NS_NewRunnableMethod and friends to mozilla::NewRunnableMethod. r=froydnj 2016-04-28 14:08:25 -07:00
Kyle Huey
c73656947b Bug 1265927: Move nsRunnable to mozilla::Runnable, CancelableRunnable to mozilla::CancelableRunnable. r=froydnj 2016-04-25 17:23:21 -07:00
Jon Coppeard
d5b6a661f0 Bug 1259021 - Rename Vector::extractRawBuffer to extractOrCopyRawBuffer r=Waldo 2016-04-25 13:41:25 +01:00
Boris Zbarsky
e3b2de6aa9 Bug 1255817 part 2. Get rid of AutoJSAPI::OwnsErrorReporting and AutoJSAPI::TakeOwnershipOfErrorReporting. r=bholley 2016-03-23 11:44:54 -04:00
Jonathan Hao
7bee2c98a0 Bug 1235572 - Enforce SRI if content signature is enforced r=francois
* * *
[mq]: sri_fix

MozReview-Commit-ID: 8vY9J4j3Eog
* * *
[mq]: loadInfo

MozReview-Commit-ID: EZ8BUfCOXO6
* * *
[mq]: add-logs

MozReview-Commit-ID: 1jeyTq9nvlW

--HG--
extra : transplant_source : %8Dj%12f%16%F5%12%8E%FE%7C%02%274%2A%A0a%C8%CB2P
2016-03-16 11:13:26 +08:00