Commit Graph

618 Commits

Author SHA1 Message Date
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
Ben Kelly
dc7660b692 Bug 1394399 P1 Default Request.credentials to "same-origin" instead of "omit". r=baku 2018-04-20 08:45:13 -07:00
Andrea Marchesini
4b23deda27 Bug 1448328 - Use thread-safe nsIURI in the URI API - part 1 - No getter/setter runnables, r=valentin 2018-04-14 01:06:35 +02:00
Sebastian Hengst
0819f35e51 Backed out 4 changesets (bug 525063) on request from Andi. a=backout
Backed out changeset 516c4fb1e4b8 (bug 525063)
Backed out changeset 6ff8aaef2866 (bug 525063)
Backed out changeset bf13e4103150 (bug 525063)
Backed out changeset d7d2f08e051c (bug 525063)
2018-04-13 16:01:28 +03:00
Tristan Bourvon
a3a77c0312 Bug 525063 - Initialize uninitialized class attributes in m-c. r=ehsan 2018-04-10 21:11:02 +02:00
Nathan Froyd
7bb7ffd8c9 Bug 1453134 - part 1 - add a string input stream constructor that accepts move references; r=baku
This method is more efficient when we know we're not going to need the
string afterwards, and should cut down on intermediate allocations.
2018-04-11 10:06:17 -04:00
Catalin Badea
1cf810fbe8 Bug 1402892 - Implement Request.destination. r=asuth,baku 2018-04-11 13:23:11 +01:00
Boris Zbarsky
1c287692f6 Bug 1452235 part 5. Stop inheriting nsISupports for nsDOMSerializer. r=qdot
MozReview-Commit-ID: 89iyRqKcAl0
2018-04-09 16:30:33 -04:00
Boris Zbarsky
a43a4c2e87 Bug 1452235 part 1. Remove nsIDOMSerializer::SerializeToStream. r=qdot
MozReview-Commit-ID: IB4W7R7Rg2P
2018-04-09 16:30:32 -04:00
Margareta Eliza Balazs
46479527fd Backed out 3 changesets (bug 1402892) for wpt failures in /fetch/api/request/request-idl.html on a CLOSED TREE
Backed out changeset 7218641c9b12 (bug 1402892)
Backed out changeset 2fce477733f0 (bug 1402892)
Backed out changeset 34e219813b64 (bug 1402892)
2018-04-09 20:01:12 +03:00
Catalin Badea
1c8f28f854 Bug 1402892 - Implement Request.destination. r=asuth,baku 2018-04-09 16:29:15 +01:00
Boris Zbarsky
4292bca4ee Bug 1449631 part 6. Remove nsIDOMEventTarget::DispatchEvent. r=smaug
MozReview-Commit-ID: 8YMgmMwZkAL
2018-04-05 13:42:41 -04:00
Dave Townsend
e2dffad4ac Bug 1448500: Add speculative request content policy type. r=bz, r=kmag
Adds a new TYPE_SPECULATIVE to nsIContentPolicy uses it as the type for
speculative connection channels from the IO service. I believe I've added it to
all the content policies in tree to make sure it behaves the same as TYPE_OTHER
used to.

The webextension test shows that the webextension proxy API sees speculative
lookups requested through the IO service.

MozReview-Commit-ID: DQ4Kq0xdUOD

--HG--
extra : rebase_source : d9460fdac118bc68f0db79749a16f181b580f2e7
2018-03-23 15:27:08 -07:00
Emilio Cobos Álvarez
4bfb789b0c Bug 1448612: Don't take ownership of the stream data too early. r=baku
MozReview-Commit-ID: F3FRoh3tR9g
2018-03-28 00:42:52 +02:00
Andrea Marchesini
446bd86ffe Bug 1445587 - Port Fetch to WorkerRef - part 4 - Fetch Request, r=smaug 2018-03-16 16:52:29 +01:00
Andrea Marchesini
2035842eaa Bug 1445587 - Port Fetch to WorkerRef - part 3 - FetchStreamReader, r=smaug 2018-03-16 16:52:29 +01:00
Andrea Marchesini
86e59d5cd5 Bug 1445587 - Port Fetch to WorkerRef - part 2 - FetchStream, r=smaug 2018-03-16 16:52:29 +01:00
Andrea Marchesini
f46c7858b5 Bug 1446204 - Response body should be marked as used if used as stream, r=till 2018-03-16 16:52:28 +01:00
Andrea Marchesini
0c3ba63569 Bug 1446174 - Fetch::Abort() should interrupt the underlying fetch, r=smaug 2018-03-16 16:52:28 +01:00
Andrea Marchesini
eb32241f0c Bug 1445587 - Port Fetch to WorkerRef - part 1 - FetchConsumer, r=smaug 2018-03-16 16:52:28 +01:00
Andrea Marchesini
94d276ca33 Bug 1445594 - Fetch must release the Promise object on the owning thread, r=catalinb 2018-03-14 16:17:08 +01:00