gecko-dev/dom/script
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
..
ModuleLoadRequest.cpp Bug 1480720 - Factor out script fetch options from script load request classes r=baku 2018-08-06 10:54:28 +01:00
ModuleLoadRequest.h Bug 1480720 - Factor out script fetch options from script load request classes r=baku 2018-08-06 10:54:28 +01:00
ModuleScript.cpp Bug 1482153 - Provide a way of associating a private value with a script or module r=jandem rs=hsivonen 2018-10-16 13:44:12 +01:00
ModuleScript.h Backed out changeset ba122021b8b5 (bug 1481196) 2018-10-04 11:50:55 +01:00
ScriptElement.cpp Bug 1470930: Use enums for passing arguments for event dispatch. r=smaug 2018-06-26 18:22:06 +02:00
ScriptElement.h
ScriptLoadHandler.cpp Bug 1480720 - Factor out script fetch options from script load request classes r=baku 2018-08-06 10:54:28 +01:00
ScriptLoadHandler.h
ScriptLoadRequest.cpp Bug 1480720 - Factor out script fetch options from script load request classes r=baku 2018-08-06 10:54:28 +01:00
ScriptLoadRequest.h Bug 1480720 - Factor out script fetch options from script load request classes r=baku 2018-08-06 10:54:28 +01:00
ScriptLoader.cpp Bug 1487100 - Allow calling nsICacheInfoChannel.preferAlternativeDataType(altDataType, contentType) multiple times r=michal,luke 2018-10-17 13:58:30 +00:00
ScriptLoader.h Bug 1482153 - Provide a way of associating a private value with a script or module r=jandem rs=hsivonen 2018-10-16 13:44:12 +01:00
ScriptSettings.cpp Bug 722345 part 3 - Remove request API. r=luke 2018-08-28 09:53:30 +02:00
ScriptSettings.h Bug 722345 part 3 - Remove request API. r=luke 2018-08-28 09:53:30 +02:00
ScriptTrace.cpp Bug 1470930: Use enums for passing arguments for event dispatch. r=smaug 2018-06-26 18:22:06 +02:00
ScriptTrace.h
moz.build Bug 1432963 - Fixing workers headers - part 17 - no LIBS=[workers] in moz.build files, r=smaug 2018-01-31 08:25:30 +01:00
nsIScriptElement.h Bug 1418246 - Return valid columnNumber value in CSP violation events, r=ckerschb 2018-07-05 08:21:04 +02:00
nsIScriptLoaderObserver.idl