gecko-dev/dom/fetch
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
..
tests Bug 1482752 - Have Fetch bodies use File blobs for local files instead of regular blobs. r=baku 2018-09-11 19:13:15 +00:00
BodyExtractor.cpp Bug 1465585: Switch from mozilla::Move to std::move. r=froydnj 2018-06-01 10:45:27 +02:00
BodyExtractor.h Bug 792808 - Migrate BodyExtractor away from using nsIXHRSendable; r=baku 2017-09-19 21:32:12 -04:00
ChannelInfo.cpp
ChannelInfo.h
ChannelInfo.ipdlh
Fetch.cpp Bug 1385890 - Fix Streams implementation in multiple-global uses. r=baku,tcampbell,jorendorff 2018-10-11 14:18:43 -05:00
Fetch.h Bug 1385890 - Fix Streams implementation in multiple-global uses. r=baku,tcampbell,jorendorff 2018-10-11 14:18:43 -05:00
FetchConsumer.cpp Bug 1385890 - Fix Streams implementation in multiple-global uses. r=baku,tcampbell,jorendorff 2018-10-11 14:18:43 -05:00
FetchConsumer.h Bug 1491504 - shortcut blob responses from XHR and fetch when the URL is a blob URL; r=baku 2018-10-06 17:34:24 +00:00
FetchDriver.cpp Bug 1487100 - Allow calling nsICacheInfoChannel.preferAlternativeDataType(altDataType, contentType) multiple times r=michal,luke 2018-10-17 13:58:30 +00:00
FetchDriver.h Bug 1478101 - Split AbortSignal in 2 classes: AbortSignal and AbortSignalImpl, r=bz 2018-08-26 14:16:21 +02:00
FetchIPCTypes.h Bug 1431295 - Drop 'undef None' macro in dom/. r=baku 2018-01-18 14:12:51 +09:00
FetchObserver.cpp Bug 1488427 - AbortSignal::Unfollow() must be called when unlinked, r=smaug 2018-09-07 11:05:47 +02:00
FetchObserver.h Bug 1478101 - Split AbortSignal in 2 classes: AbortSignal and AbortSignalImpl, r=bz 2018-08-26 14:16:21 +02:00
FetchStream.cpp Bug 1385890 - Fix Streams implementation in multiple-global uses. r=baku,tcampbell,jorendorff 2018-10-11 14:18:43 -05:00
FetchStream.h Bug 1445587 - Port Fetch to WorkerRef - part 2 - FetchStream, r=smaug 2018-03-16 16:52:29 +01:00
FetchStreamReader.cpp Bug 1465585: Switch from mozilla::Move to std::move. r=froydnj 2018-06-01 10:45:27 +02:00
FetchStreamReader.h Bug 1445587 - Port Fetch to WorkerRef - part 3 - FetchStreamReader, r=smaug 2018-03-16 16:52:29 +01:00
FetchTypes.ipdlh Bug 1416842 - Allow fetch to reject with nsresult in chrome code. r=bkelly 2017-11-15 14:53:42 -05:00
FetchUtil.cpp Bug 1385890 - Fix Streams implementation in multiple-global uses. r=baku,tcampbell,jorendorff 2018-10-11 14:18:43 -05:00
FetchUtil.h Bug 1432963 - Fixing workers headers - part 14 - WorkerPrivate without workers namespace, r=smaug 2018-01-31 08:24:08 +01:00
Headers.cpp Bug 1470325 - s/FooBinding/Foo_Binding/g - r=qdot 2018-06-26 17:05:01 -07:00
Headers.h
InternalHeaders.cpp Bug 1434686 part 4. Use IgnoreErrors() in dom/. r=mystor 2018-02-01 14:21:14 -05:00
InternalHeaders.h Bug 1396848 - Iterating a Header object returns sorted and combined values, r=qdot 2017-09-17 11:18:20 +02:00
InternalRequest.cpp Bug 1453795 - DOM - Initialize member fields in classes/ structures. r=peterv 2018-06-16 17:21:46 +03:00
InternalRequest.h Bug 1491504 - shortcut blob responses from XHR and fetch when the URL is a blob URL; r=baku 2018-10-06 17:34:24 +00:00
InternalResponse.cpp Bug 1465585: Switch from mozilla::Move to std::move. r=froydnj 2018-06-01 10:45:27 +02:00
InternalResponse.h Bug 1491504 - shortcut blob responses from XHR and fetch when the URL is a blob URL; r=baku 2018-10-06 17:34:24 +00:00
Request.cpp Bug 1385890 - Fix Streams implementation in multiple-global uses. r=baku,tcampbell,jorendorff 2018-10-11 14:18:43 -05:00
Request.h Bug 1491504 - shortcut blob responses from XHR and fetch when the URL is a blob URL; r=baku 2018-10-06 17:34:24 +00:00
Response.cpp Bug 1453612 - Response.redirect() should have empty string statusText. r=baku 2018-10-14 16:36:00 +03:00
Response.h Bug 1491504 - shortcut blob responses from XHR and fetch when the URL is a blob URL; r=baku 2018-10-06 17:34:24 +00:00
moz.build Bug 1482752 - Have Fetch bodies use File blobs for local files instead of regular blobs. r=baku 2018-09-11 19:13:15 +00:00