gecko-dev/netwerk/test/unit_ipc
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
..
.eslintrc.js
child_channel_id.js
child_cookie_header.js
head_channels_clone.js
test_XHR_redirects.js
test_alt-data_cross_process_wrap.js Bug 1487100 - Allow calling nsICacheInfoChannel.preferAlternativeDataType(altDataType, contentType) multiple times r=michal,luke 2018-10-17 13:58:30 +00:00
test_alt-data_simple_wrap.js
test_alt-data_stream_wrap.js
test_bug528292_wrap.js
test_cache-entry-id_wrap.js
test_cache_jar_wrap.js
test_cacheflags_wrap.js
test_channel_close_wrap.js
test_channel_id.js
test_channel_priority_wrap.js
test_chunked_responses_wrap.js
test_cookie_header_stripped.js
test_cookiejars_wrap.js
test_dns_cancel_wrap.js
test_dns_service_wrap.js
test_duplicate_headers_wrap.js
test_event_sink_wrap.js
test_getHost_wrap.js
test_head_wrap.js
test_headers_wrap.js
test_httpsuspend_wrap.js
test_multipart_streamconv_wrap.js
test_original_sent_received_head_wrap.js
test_post_wrap.js
test_predictor_wrap.js
test_progress_wrap.js
test_redirect-caching_canceled_wrap.js
test_redirect-caching_failure_wrap.js
test_redirect-caching_passing_wrap.js
test_redirect_canceled_wrap.js
test_redirect_different-protocol_wrap.js
test_redirect_failure_wrap.js
test_redirect_from_script_wrap.js
test_redirect_history_wrap.js
test_redirect_passing_wrap.js
test_reentrancy_wrap.js
test_reply_without_content_type_wrap.js
test_resumable_channel_wrap.js
test_simple_wrap.js
test_synthesized_response_wrap.js
test_trackingProtection_annotateChannels_wrap1.js
test_trackingProtection_annotateChannels_wrap2.js
test_xmlhttprequest_wrap.js
xpcshell.ini