Commit Graph

212 Commits

Author SHA1 Message Date
Andrea Marchesini
dbce6a100e Bug 1487113 - nsICacheInfoChannel.preferAlternativeDataType() should expose alt-data as optional if required, r=valentin
Differential Revision: https://phabricator.services.mozilla.com/D20200
2019-02-19 07:38:31 +00:00
Gurzau Raul
b076cdcb1b Merge inbound to mozilla-central. a=merge 2019-02-14 19:01:42 +02:00
shindli
6d6a1db76c Merge mozilla-central to inbound. a=merge CLOSED TREE 2019-02-14 06:58:32 +02:00
Christoph Kerschbaumer
32d08a3f59 Bug 1509738: CSP snapshot nonce at load start time. r=baku 2019-02-13 20:45:29 +01:00
Markus Stange
033a10c4ae Bug 1515209 - Add a text marker for <script> evaluation. r=gerald
Differential Revision: https://phabricator.services.mozilla.com/D19189
2019-02-14 05:25:13 +00:00
Noemi Erli
2e1d1354be Backed out 2 changesets (bug 1509738) for failures in propagate-nonce-external-classic.html
Backed out changeset fbf4b73c8786 (bug 1509738)
Backed out changeset 53f624bc7c22 (bug 1509738)
2019-02-13 16:22:44 +02:00
Christoph Kerschbaumer
c1ff44121f Bug 1509738 - CSP snapshot nonce at load start time. r=baku 2019-02-13 13:46:50 +01:00
Andreea Pavel
4aa849f479 Backed out 2 changesets (bug 1509738) for failing propagate-nonce-external-classic.html on a CLOSED TREE
Backed out changeset 5cbc3f79a126 (bug 1509738)
Backed out changeset 44a945b21f87 (bug 1509738)
2019-02-13 02:18:28 +02:00
Christoph Kerschbaumer
6d9b21d4d2 Bug 1509738: CSP snapshot nonce at load start time r=baku
Differential Revision: https://phabricator.services.mozilla.com/D19519
2019-02-12 18:01:32 +00:00
Jonathan Kingston
58708e007c Bug 1520868 - Replacing AsyncOpen2 with AsyncOpen always r=valentin
Replacing js and text occurences of asyncOpen2
Replacing open2 with open

Differential Revision: https://phabricator.services.mozilla.com/D16885
2019-02-12 16:08:25 +00:00
Jon Coppeard
4f9d93a86a Bug 1525627 - Report an error if there's no ScriptLoader for the current context. r=baku 2019-02-08 09:16:00 +02:00
Tom Schuster
dbd070f8e6 Bug 1525006 - Add a new internal ContentPolicyType for ES6 modules. r=ckerschb
Differential Revision: https://phabricator.services.mozilla.com/D19269
2019-02-12 13:16:32 +00:00
Sylvestre Ledru
0ac7481368 Bug 1519636 - Reformat recent changes to the Google coding style r=Ehsan
# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D18488
2019-02-04 19:10:18 +00:00
Jon Coppeard
578a94e6f5 Bug 1523897 - Only initialize debugger data for modules the first time they are executed r=smaug 2019-02-01 10:26:14 +00:00
Andrea Marchesini
5a9e597f3d Bug 1522210 - Fingerprinting and cryptomining classifiers must have separate nsIWebProgressListener blocking state codes - part 1 - UrlClassifierFeatureFactory::IsClassifierBlockingErrorCode, r=ehsan
Differential Revision: https://phabricator.services.mozilla.com/D17637
2019-01-30 13:43:34 +01:00
Eric Faust
ede2067cf5 Bug 1520274 - Allow serving BinAST scripts with nosniff. (r=baku, r=dveditz) 2019-01-30 10:50:47 -08:00
Randell Jesup
682721b83e Bug 1522150: Add a DeferredTimers queue ahead of the normal Idle EventQueue r=froyd
* * *
Bug 1522150: Rename NS_IdleDispatch* functions since they take queue identifiers r=froyd
2019-01-26 12:18:05 -05:00
Markus Stange
ece40afe6c Bug 1514007 - Annotate <script> evaluation profiler labels with async/defer. r=smaug
This also moves the label from ScriptLoader::ProcessScriptElement to
ScriptLoader::EvaluateScript so that it also kicks in for scripts that are run
from NotifyOffThreadScriptLoadCompletedRunnable::Run.

Differential Revision: https://phabricator.services.mozilla.com/D14924
2019-01-25 20:38:39 +00:00
Jon Coppeard
908a5ca629 Bug 1513014 - Defer reporting errors while preloading until the request is actually used r=smaug 2019-01-24 14:57:30 +00:00
Razvan Maries
32cfc0649c Merge mozilla-inbound to mozilla-central a=merge 2019-01-21 19:50:56 +02:00
Sylvestre Ledru
717842459d Bug 1519636 - Reformat recent changes to the Google coding style r=Ehsan
# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D17063
2019-01-21 14:49:22 +00:00
Jon Coppeard
7975ddd425 Bug 1518075 - Add another check for null script because compilation can 'succeed' if scripting is disabled r=smaug 2019-01-21 12:40:55 +00:00
Jon Coppeard
79adfa338b Bug 1519140 - Add AddRef/Release hooks for embedding's script or module private value and set this script source object where appropriate r=jandem 2019-01-18 13:37:43 +00:00
Sylvestre Ledru
1b7e81a0bc Bug 1519636 - Reformat everything to the Google coding style r=Ehsan
# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D16388
2019-01-16 08:50:07 +00:00
Brian Hackett
75e63e104c Bug 1517167 Part 1 - Set introduction information for dynamically generated <script> elements, r=jorendorff. 2019-01-03 06:27:01 -10:00
Jon Coppeard
8f3ee34e7a Bug 1518075 - Add check for null script because compilation can 'succeed' if scripting is disabled r=smaug 2019-01-08 10:41:48 +00:00
Emilio Cobos Álvarez
dc336a73ba Bug 1517241 - Rename nsIDocument to mozilla::dom::Document. r=smaug
Summary: Really sorry for the size of the patch. It's mostly automatic
s/nsIDocument/Document/ but I had to fix up in a bunch of places manually to
add the right namespacing and such.

Overall it's not a very interesting patch I think.

nsDocument.cpp turns into Document.cpp, nsIDocument.h into Document.h and
nsIDocumentInlines.h into DocumentInlines.h.

I also changed a bunch of nsCOMPtr usage to RefPtr, but not all of it.

While fixing up some of the bits I also removed some unneeded OwnerDoc() null
checks and such, but I didn't do anything riskier than that.
2019-01-03 17:48:33 +01:00
Jon Coppeard
371d8aa66b Bug 1342012 - Make import() work when the active script is in another document r=smaug 2019-01-03 10:06:01 +00:00
Jon Coppeard
0fb9274ac3 Bug 1342012 - Fix error message that covers all import() failures that don't throw a JS exception r=jandem 2019-01-03 10:06:00 +00:00
Jon Coppeard
bdcf798047 Bug 1342012 - Also associate classic scripts from the bytecode cache r=smaug 2019-01-03 10:06:00 +00:00
Jon Coppeard
f12538ad6b Bug 1342012 - Allow dynamic import in cases where there's no referencing script or module r=smaug 2018-12-06 16:52:18 -05:00
Jon Coppeard
3bf8514600 Bug 1342012 - Make load request element optional r=smaug 2018-12-06 16:52:18 -05:00
Jon Coppeard
0d30659e5f Bug 1342012 - Support import from timeout handlers by associating the initiating script with the compiled JSScript r=smaug 2018-12-06 16:52:18 -05:00
Jon Coppeard
2ff479b8d2 Bug 1342012 - Support dynamic import from classic scripts by creating ClassicScript objects and associating them with the compiled JSScriptsr r=smaug 2018-12-06 16:52:17 -05:00
Jon Coppeard
accbd30ca2 Bug 1342012 - Refactor nsJSUtils::ExecutionContext to separate compilation and execution steps and allow extraction of compiled JSScript r=nbp r=smaug 2018-12-06 16:52:16 -05:00
Jon Coppeard
30b5587e3d Bug 1342012 - Rename ModuleScript source files to LoadedScript r=smaug 2018-12-06 16:52:16 -05:00
Jon Coppeard
6e8ed561b5 Bug 1342012 - Initial browser support for dynamic import from module scripts r=smaug 2018-12-06 16:52:15 -05:00
Ehsan Akhgari
5b90a278b7 Bug 1510817 - Don't doubly warn when we can't load a script due to tracking protection; r=baku
Differential Revision: https://phabricator.services.mozilla.com/D14861
2018-12-18 15:19:02 +00:00
Jean-Yves Avenard
aab188dd98 Bug 1512456 - P8. Use GenericNonExclusivePromise where needed. r=gerald,alwu
Those MozPromises are shared and must be made non-exclusive

Differential Revision: https://phabricator.services.mozilla.com/D14032
2018-12-11 10:47:01 +00:00
Sylvestre Ledru
e5a134f73a Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
# ignore-this-changeset
2018-11-30 11:46:48 +01:00
Jeff Walden
bbdfc94aae Bug 1510007 - Move JSFreeOp's definition to js/public/MemoryFunctions.h, and make jsapi.h not #include that header. r=sfink 2018-11-21 18:11:15 -08:00
Brian Hackett
4dab0e7d06 Bug 1505935 Part 5 - Remove unnecessary NoteContentParse call, r=froydnj. 2018-11-10 15:28:50 -10:00
Thomas Nguyen
60ca74e33c Bug 1460920 - Part 2 : Support referrerpolicy attribute in script HTMLScriptElement r=hsivonen
The patch adds the support of referrerpolicy attribute in script element
and take the attribute into account when loading script.

Differential Revision: https://phabricator.services.mozilla.com/D11637
2018-11-13 14:33:02 +00:00
Jeff Walden
28b00b916d Bug 1485800 - Rename SourceBufferHolder to SourceText, and add a <typename Unit> template parameter to it so it can hold putative UTF-8 or UTF-16 source text. r=tcampbell, r=fitzgen 2018-11-08 18:42:48 -08:00
Jeff Walden
bea599041d Bug 1503086 - Initialize all SourceBufferHolders with a fallible function that in all cases assumes ownership of given-ownership data. r=tcampbell, r=bz, r=mrbkap on some finicky worker code lightly touched here 2018-10-23 12:27:16 -07:00
Kris Maglione
87a66e6f27 Bug 1356412: Part 2 - Remove script loader path mangling from DOM code. r=bz
As in part 1, this no longer serves any purpose.

This patch also removes the otherwise unused WrappersEnabled() method, which
was similarly only useful before we had compartment-based security isolation.
Its functionality is now handled by compartment flags.

Differential Revision: https://phabricator.services.mozilla.com/D10796
2018-11-02 16:15:26 -07:00
Andrea Marchesini
57bd031744 Bug 1498510 - Move nsICSPEventListener out of CSP object, r=ckerschb 2018-10-23 08:17:13 +02:00
Valentin Gosu
c5da4687a9 Bug 1487100 - Allow calling nsICacheInfoChannel.preferAlternativeDataType(altDataType, contentType) multiple times r=michal,luke
This patch changes the way we set and handle the preferred alternate data type.
It is no longer just one choice, but a set of preferences, each conditional
on the contentType of the resource.

For example:
  var cc = chan.QueryInterface(Ci.nsICacheInfoChannel);
  cc.preferAlternativeDataType("js-bytecode", "text/javascript");
  cc.preferAlternativeDataType("ammended-text", "text/plain");
  cc.preferAlternativeDataType("something-else", "");

When loaded from the cache, the available alt-data type will be checked against
"js-bytecode" if the contentType is "text/javascript", "ammended-text" if the contentType is "text/plain" or "something-else" for all contentTypes.
Note that the alt-data type could be "something-else" even if the contentType is "text/javascript".

The preferences are saved as an nsTArray<mozilla::Tuple<nsCString, nsCString>>.

Differential Revision: https://phabricator.services.mozilla.com/D8071
2018-10-17 13:58:30 +00:00
Dorel Luca
c3aaaf326f Backed out 2 changesets (bug 1487100) for XPCShell failures in netwerk/test/unit_ipc/test_alt-data_simple_wrap.js
Backed out changeset 7f9d03c29a6f (bug 1487100)
Backed out changeset dd1c31ea78c2 (bug 1487100)
2018-10-18 05:51:42 +03:00
Valentin Gosu
6c76c8f00e Bug 1487100 - Allow calling nsICacheInfoChannel.preferAlternativeDataType(altDataType, contentType) multiple times r=michal,luke
This patch changes the way we set and handle the preferred alternate data type.
It is no longer just one choice, but a set of preferences, each conditional
on the contentType of the resource.

For example:
  var cc = chan.QueryInterface(Ci.nsICacheInfoChannel);
  cc.preferAlternativeDataType("js-bytecode", "text/javascript");
  cc.preferAlternativeDataType("ammended-text", "text/plain");
  cc.preferAlternativeDataType("something-else", "");

When loaded from the cache, the available alt-data type will be checked against
"js-bytecode" if the contentType is "text/javascript", "ammended-text" if the contentType is "text/plain" or "something-else" for all contentTypes.
Note that the alt-data type could be "something-else" even if the contentType is "text/javascript".

The preferences are saved as an nsTArray<mozilla::Tuple<nsCString, nsCString>>.

Differential Revision: https://phabricator.services.mozilla.com/D8071
2018-10-17 13:58:30 +00:00