Commit Graph

638 Commits

Author SHA1 Message Date
Jason Orendorff
a942af532c Bug 1506200 - Remove ReadableStream EmbeddingFlags. r=baku,jwalden
Differential Revision: https://phabricator.services.mozilla.com/D11903

--HG--
extra : moz-landing-system : lando
2018-11-28 22:20:55 +00:00
Ehsan Akhgari
6099c9f67b Bug 1508472 - Part 1: First batch of comment fix-ups in preparation for the tree reformat r=sylvestre
This is a best effort attempt at ensuring that the adverse impact of
reformatting the entire tree over the comments would be minimal.  I've used a
combination of strategies including disabling of formatting, some manual
formatting and some changes to formatting to work around some clang-format
limitations.

Differential Revision: https://phabricator.services.mozilla.com/D13046

--HG--
extra : moz-landing-system : lando
2018-11-27 10:08:58 +00:00
Jason Orendorff
dfbf2f8e7b Bug 1507247 - jsapi.h should not #include "js/Stream.h". r=jwalden
Differential Revision: https://phabricator.services.mozilla.com/D11929

--HG--
extra : moz-landing-system : lando
2018-11-22 17:34:39 +00:00
Andrea Marchesini
89f6169d5f Bug 1508661 - origin header should not be set for GET and HEAD requests, r=asuth 2018-11-21 11:33:47 +01:00
Andrea Marchesini
65426a1db4 Bug 1478850 - FetchStreamReader must call HoldJSObject()/DropJSObjects, r=smaug 2018-11-20 18:24:26 +01:00
Andrea Marchesini
551f6ace99 Bug 1507893 - Fetch() should consume DOM Files on the target thread only, r=twisniewski 2018-11-20 18:08:34 +01:00
Andrea Marchesini
c292b31a93 Bug 1438945 - Part 9: RemoteWorker in SharedWorkerManager. r=asuth
--HG--
extra : rebase_source : 07a23a3f76ef06d76a456ba785186018e6fb77f1
2018-11-19 15:18:33 -08:00
Andrea Marchesini
9c8f8ff9cc Bug 1438945 - Part 4: errors and communications. r=asuth
--HG--
extra : rebase_source : a73007e48d52c47c698dd2545ae4d61806a3ab53
2018-11-19 15:18:21 -08:00
Luke Wagner
00940fee0d Bug 1505632 - Baldr: correctly propagate AbortError from consume stream body operation (r=lth,baku,Ms2ger) 2018-11-16 10:32:20 -06:00
Jonathan Kingston
8c28f0c4a4 Bug 1483815 - Implement stricter CORS checking for headers. r=ckerschb
Differential Revision: https://phabricator.services.mozilla.com/D11648

--HG--
extra : moz-landing-system : lando
2018-11-14 11:45:46 +00:00
Andrea Marchesini
7797a1a972 Bug 1387503 - FestStreamReader should cancel the reader when the worker shutdowns, r=jorendorff 2018-11-12 14:44:39 +01:00
Andrea Marchesini
ebf242be0d Bug 1500879 - Fetch should not consume Request/Response with null-body, r=asuth
The fetch spec treats null bodies specially.  Their Body cannot become
disturbed or locked and a fresh empty ReadableStream is returned whenever an
attempt is made to consume the body.  We currently fail a number of WPT tests
in this area because we do mark the body consumed as exposed via bodyUsed.
2018-11-06 14:48:07 +01:00
Junior Hsu
3986ef8afc Bug 1277496 - use nsHttp::Origin instead of literal cstring r=francois
Differential Revision: https://phabricator.services.mozilla.com/D10752

--HG--
extra : moz-landing-system : lando
2018-11-05 21:40:36 +00:00
Andrea Marchesini
e16216247d Bug 1503602 - Use the Response's global to create the ReadableStream reader to consume the body, r=bz 2018-11-01 22:46:30 +01:00
Andrea Marchesini
32bc82fcb9 Bug 1503901 - Cleanup exceptions during the shutdown of FetchStreamReader, r=bz 2018-11-01 17:57:38 +01:00
Andrea Marchesini
223d7172bf Bug 1486698 - Update Fetch+Stream implementation to throw when the stream is disturbed or locked, r=bz
In this patch, I went through any place in DOM fetch code, where there are
ReadableStreams and update the locked, disturbed, readable checks.

Because we expose streams more often, we need an extra care in the use of
ErrorResult objects. JS streams can now throw exceptions and we need to handle
them.

This patch also fixes a bug in FileStreamReader::CloseAndRelease() which could
be called in case mReader creation fails.
2018-10-31 18:30:18 +01:00
Andrea Marchesini
4ba16f8d4b Bug 1503276 - Response.redirect() should throw TypeError if the input is an invalid URL, r=smaug 2018-10-30 20:07:28 +01:00
Andrea Marchesini
2680372dcf Bug 1501354 - Fetch() should not block the loadgroup from completing, r=bz 2018-10-27 08:55:20 +02:00
Mark Banner
a26105ff45 Bug 1501662 - Add more .eslintrc.js files for test directories (dom, modules, netwerk and parser). r=mossop
Differential Revision: https://phabricator.services.mozilla.com/D9661

--HG--
extra : moz-landing-system : lando
2018-10-24 19:11:17 +00:00
Andrea Marchesini
4439acd683 Bug 1498510 - Move nsICSPEventListener out of CSP object, r=ckerschb 2018-10-23 08:17:13 +02:00
Valentin Gosu
5ac68030f7 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

--HG--
extra : rebase_source : eb4961f05a52e557e7d2d986d59e0a2cf18a3447
extra : source : dd1c31ea78c2b15d14750d137037a54d50719997
2018-10-17 13:58:30 +00:00
Dorel Luca
1a48c88d19 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
e392dbc5dd 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

--HG--
extra : moz-landing-system : lando
2018-10-17 13:58:30 +00:00
Diego Pino Garcia
8feb556198 Bug 1453612 - Response.redirect() should have empty string statusText. r=baku 2018-10-14 16:36:00 +03:00
Till Schneidereit ext:(%2C%20Jason%20Orendorff%20%3Cjorendorff%40mozilla.com%3E)
2cfba34b8d Bug 1385890 - Fix Streams implementation in multiple-global uses. r=baku,tcampbell,jorendorff
Streams have multiple parts that can be JS objects from different compartments.
For example, the [[reader]] internal slot of a stream can point to a reader
object in another compartment.

This patch makes the ReadableStream implementation robust against mixing and
matching stream-related objects and methods from different globals.

This also removes ReadableStreamBYOBReader and ReadableStreamBYOBRequest for
now, with a view toward enabling basic ReadableStream features by default in
bug 1389628.

Differential Revision: https://phabricator.services.mozilla.com/D8450

--HG--
extra : rebase_source : 71d73bed5bc82557efcb6b1ecb231275fd3e1189
extra : amend_source : de29f663b9929eb2858b23cc6f4e7ba97b23a28c
extra : source : f91eb962df6a06d5f51ad13caa2a4a9c2947f293
2018-10-11 14:18:43 -05:00
Thomas Wisniewski
ba1f0dc311 Bug 1496621 - reject Fetch promises with (informative) TypeErrors when decoding fails, per spec; r=baku
reject Fetch promises with (informative) TypeErrors when decoding fails, per spec

Differential Revision: https://phabricator.services.mozilla.com/D7970

--HG--
extra : moz-landing-system : lando
2018-10-08 23:57:23 +00:00
Thomas Wisniewski
d23454328e Bug 1491504 - shortcut blob responses from XHR and fetch when the URL is a blob URL; r=baku
shortcut blob responses from XHR and fetch when the URL is a blob URL

Differential Revision: https://phabricator.services.mozilla.com/D7253

--HG--
extra : moz-landing-system : lando
2018-10-06 17:34:24 +00:00
Ciure Andrei
47efccbbca Backed out changeset c5ac0cb25238 (bug 1491504) for FetchConsumer.cpp build bustages CLOSED TREE 2018-10-06 02:58:44 +03:00
Thomas Wisniewski
2294c78986 Bug 1491504 - shortcut blob responses from XHR and fetch when the URL is a blob URL; r=baku
shortcut blob responses from XHR and fetch when the URL is a blob URL

Differential Revision: https://phabricator.services.mozilla.com/D7253

--HG--
extra : moz-landing-system : lando
2018-10-05 20:23:55 +00:00
Jason Orendorff
e6ab602a75 Bug 1491939 - Part 4: Enable streams on a per-realm basis. Drop dom.streams.enabled and dom.workers.options.streams; use only javascript.options.streams. r=baku
Depends on D6555

Differential Revision: https://phabricator.services.mozilla.com/D6556

--HG--
extra : moz-landing-system : lando
2018-09-25 14:11:41 +00:00
Tom Tung
b98b2f6c82 Bug 1486445 - P1 - Propagate the sw internally redirected URL to fetching request; r=asuth
Bug 1222008 didn't propagate a sw redirected URL to outer response properly. To
fix that this patch mainly make a redirecting request be overwritten while it's
redirected by a service worker. This patch also add a private setter function
for InternalRequest and a public checking function to avoid that function from
being used widely.

Differential Revision: https://phabricator.services.mozilla.com/D4762

--HG--
extra : moz-landing-system : lando
2018-09-12 12:44:30 +00:00
Thomas Wisniewski
400093bdb6 Bug 1482752 - Have Fetch bodies use File blobs for local files instead of regular blobs. r=baku
Have Fetch bodies use File blobs for local files instead of regular blobs.

Differential Revision: https://phabricator.services.mozilla.com/D3183

--HG--
extra : moz-landing-system : lando
2018-09-11 19:13:15 +00:00
Cosmin Sabou
dc72962df3 Backed out changeset 68805212630a (bug 1482752) for causing build bustages on dom/fetch. CLOSED TREE 2018-09-08 20:46:04 +03:00
Thomas Wisniewski
4d92a94c0d Bug 1482752 - Have Fetch bodies use File blobs for local files instead of regular blobs. r=baku
Have Fetch bodies use File blobs for local files instead of regular blobs.

Differential Revision: https://phabricator.services.mozilla.com/D3183

--HG--
extra : moz-landing-system : lando
2018-09-08 14:34:37 +00:00
Andrea Marchesini
1393a9184a Bug 1488427 - AbortSignal::Unfollow() must be called when unlinked, r=smaug 2018-09-07 11:05:47 +02:00
Andrea Marchesini
6ea7fbc592 Bug 1480366 - Traverse/Unlink mAbortFollowing in any object exposed to content, r=smaug 2018-08-28 17:27:58 +02:00
Andrea Marchesini
e1a0b51543 Bug 1478101 - Split AbortSignal in 2 classes: AbortSignal and AbortSignalImpl, r=bz 2018-08-26 14:16:21 +02:00
Thomas Wisniewski
2e507aec05 Bug 1453301 - Stop supporting about:blank in fetch to match the spec. r=baku
MozReview-Commit-ID: DMku5SAunfo

--HG--
extra : rebase_source : d9cf72be144b41cd5d8c6dbe4042a6e835c12ef3
2018-08-03 21:52:36 -04:00
Jan de Mooij
0873f847dd Bug 1474542 - Use the unwrapped object's global in FetchUtil::StreamResponseToJS. r=luke 2018-07-26 10:52:01 +02:00
Valentin Gosu
7937c7c4cc Bug 1476928 - Remove nsIURI.CloneIgnoringRef and nsIURI.CloneWithNewRef r=JuniorHsu
The patch introduces NS_GetURIWithNewRef and NS_GetURIWithNewRef which perform the same function.

Differential Revision: https://phabricator.services.mozilla.com/D2239

--HG--
extra : moz-landing-system : lando
2018-07-23 11:28:47 +00:00
Andrea Marchesini
bc5414c5f3 Bug 1471189 - Removing 'Terminating' state in workers, r=mrbkap 2018-07-12 19:33:41 +02:00
Andi-Bogdan Postelnicu
88cc63910d Bug 1453795 - DOM - Initialize member fields in classes/ structures. r=peterv
--HG--
extra : rebase_source : 249fc26e50bded4e94f5effa4308af0f1e54b908
2018-06-16 17:21:46 +03:00
Jeff Gilbert
5b753da289 Bug 1470325 - s/FooBinding/Foo_Binding/g - r=qdot
MozReview-Commit-ID: JtTcLL5OPF0
2018-06-26 17:05:01 -07:00
Chris Peterson
2afd829d0f Bug 1469769 - Part 6: Replace non-failing NS_NOTREACHED with MOZ_ASSERT_UNREACHABLE. r=froydnj
This patch is an automatic replacement of s/NS_NOTREACHED/MOZ_ASSERT_UNREACHABLE/. Reindenting long lines and whitespace fixups follow in patch 6b.

MozReview-Commit-ID: 5UQVHElSpCr

--HG--
extra : rebase_source : 4c1b2fc32b269342f07639266b64941e2270e9c4
extra : source : 907543f6eae716f23a6de52b1ffb1c82908d158a
2018-06-17 22:43:11 -07:00
Andrea Marchesini
7ba8b77e07 Bug 1466023 - Separate FontTableURI and BlobURL, r=qdot
This patch splits FontTableURI and BlobURL in 2 classes:
FontTableURIProtocolHandler and BlobURLProtocolHandler
both under mozilla::dom.

It also removes a memory reporter because that report is already covered by the
BlobURL one.

--HG--
rename : dom/file/nsHostObjectProtocolHandler.cpp => dom/file/BlobURLProtocolHandler.cpp
rename : dom/file/nsHostObjectProtocolHandler.h => dom/file/BlobURLProtocolHandler.h
2018-06-02 15:51:42 +02:00
Emilio Cobos Álvarez
fffb25b74f Bug 1465585: Switch from mozilla::Move to std::move. r=froydnj
This was done automatically replacing:

  s/mozilla::Move/std::move/
  s/ Move(/ std::move(/
  s/(Move(/(std::move(/

Removing the 'using mozilla::Move;' lines.

And then with a few manual fixups, see the bug for the split series..

MozReview-Commit-ID: Jxze3adipUh
2018-06-01 10:45:27 +02:00
Ben Kelly
00d42d9d6b Bug 1457157 P2 Clear a worker's ClientSource when it reaches Terminating. r=baku 2018-05-02 06:29:26 -07:00
Andrea Marchesini
f6fc0b418a Bug 1456556 - FetchConsumer scope-exit RAII must grab 'self' by value, r=erahm 2018-05-01 08:47:13 +02:00
Andrea Marchesini
2aa16211a9 Bug 1455811 - ReadableStream.cancel() must cancel the actual download - part 2, r=bkelly 2018-04-24 16:10:38 +02:00
Andrea Marchesini
8617b48e8e Bug 1455811 - ReadableStream.cancel() must cancel the actual download - part 1, r=bkelly 2018-04-24 16:09:58 +02:00