Commit Graph

6942 Commits

Author SHA1 Message Date
Nicholas Hurley
27190f4a59 Bug 1434137 - Implement websockets over http/2 - RFC 8441 r=michal,dragana
https://tools.ietf.org/html/rfc8441

This uses our existing http/2 CONNECT infrastructure (modified) to
enable the new extended CONNECT form defined by 8441, and pretend for
the websocket's sake that an http/2 stream is actually a socket. From
the websocket's point of view, this is relatively non-invasive - a few
things have changed (http response code, absence of some headers) versus
http/1.1 websockets, but for the most part, the websocket code doesn't
care.

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

--HG--
extra : moz-landing-system : lando
2018-11-06 19:29:57 +00: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
Brindusan Cristian
350fbdf6f5 Backed out 2 changesets (bug 1501503) as requested by bradwerth on the ticket.
Backed out changeset 814414676c25 (bug 1501503)
Backed out changeset c2d9f82adf43 (bug 1501503)
2018-11-03 15:03:29 +02:00
Ciure Andrei
83010e5db0 Merge inbound to mozilla-central. a=merge 2018-11-02 18:44:43 +02:00
Honza Bambas
f9a8f6aba1 Bug 1502055 - Make nsHttpChannel::ResumeInternal keep order of transaction pump OnStopRequest before cache pump OnStartRequest, r=dragana
--HG--
extra : histedit_source : a578146bb50df79f060e341fe9a2fa8be8224aa0
2018-10-31 05:36:00 +02:00
Ehsan Akhgari
164805ba94 Bug 1502774 - Part 2: Remove XPCOM component registrations for auth module classes r=valentin
Depends on D10025

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

--HG--
extra : moz-landing-system : lando
2018-11-01 10:39:58 +00:00
Ehsan Akhgari
001d26e9ea Bug 1502774 - Part 1: Remove XPCOM component registrations for HTTP authenticator classes r=valentin
Differential Revision: https://phabricator.services.mozilla.com/D10025

--HG--
extra : moz-landing-system : lando
2018-11-01 14:21:47 +00:00
Michael Kohler
a2423373a9 Bug 1501621 - Enable ESLint for netwerk/dns/ and netwerk/protocol/ (manual changes) r=dragana,Standard8
Depends on D10590

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

--HG--
extra : moz-landing-system : lando
2018-11-02 10:38:14 +00:00
Michael Kohler
d7204e528f Bug 1501621 - Enable ESLint for netwerk/dns/ and netwerk/protocol/ (automatic changes) r=dragana,Standard8
Differential Revision: https://phabricator.services.mozilla.com/D10590

--HG--
extra : moz-landing-system : lando
2018-11-02 10:38:01 +00:00
Brad Werth
d2f14e17cc Bug 1501503: Report cross-origin load failures in more cases. r=ckerschb
Differential Revision: https://phabricator.services.mozilla.com/D9807

--HG--
extra : moz-landing-system : lando
2018-10-31 18:56:10 +00:00
Kershaw Chang
070976655b Bug 1484947 - Close the transaction if PR_Read/PR_Write failed, r=nwgh
When PR_Read/PR_White returns -1, we have to use ErrorAccordingToNSPR to get the error code. We need to close the transaction if the real error happens.

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

--HG--
extra : moz-landing-system : lando
2018-10-31 09:32:40 +00:00
Kershaw Chang
fc9640b527 Bug 1496422 - Use top level content window id if the request's window id is not available r=mayhemer
The inner window id here is used to log the error message to the right web console.
So, top level content window id should work properly if we can't get the inner window id directly from the request.

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

--HG--
extra : moz-landing-system : lando
2018-10-30 17:11:17 +00:00
Ciure Andrei
57619c2e49 Merge autoland to mozilla-central. a=merge 2018-10-31 00:04:23 +02:00
Andreea Pavel
3770da1a92 Backed out 3 changesets (bug 1502774) for causing multiple crashes - bug 1503201 a=backout
Backed out changeset 6b821f5b12ae (bug 1502774)
Backed out changeset b3bf57d996a7 (bug 1502774)
Backed out changeset 32a581482291 (bug 1502774)

--HG--
rename : extensions/auth/nsIAuthModule.cpp => extensions/auth/nsAuthFactory.cpp
2018-10-30 21:18:29 +02:00
Dragana Damjanovic
dd7c87fd1f Bug 1503011 - Make sure DNSPrefetch is called. r=mayhemer
Differential Revision: https://phabricator.services.mozilla.com/D10118

--HG--
extra : moz-landing-system : lando
2018-10-30 10:27:28 +00:00
Ehsan Akhgari
5fef8e924c Bug 1501978 - Part 1: Stop honouring the browser.contentblocking.enabled pref in Gecko r=baku
Differential Revision: https://phabricator.services.mozilla.com/D10074

--HG--
extra : moz-landing-system : lando
2018-10-30 14:30:15 +00:00
Ehsan Akhgari
51908697bd Bug 1502774 - Part 2: Remove XPCOM component registrations for auth module classes r=valentin
Depends on D10025

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

--HG--
extra : moz-landing-system : lando
2018-10-29 14:59:16 +00:00
Ehsan Akhgari
a064a33bed Bug 1502774 - Part 1: Remove XPCOM component registrations for HTTP authenticator classes r=valentin
Differential Revision: https://phabricator.services.mozilla.com/D10025

--HG--
extra : moz-landing-system : lando
2018-10-29 14:59:14 +00:00
Narcis Beleuzu
3467484554 Backed out 3 changesets (bug 1502774) for mingwclang bustages on include/sspi.h. CLOSED TREE
Backed out changeset a1f9c4666855 (bug 1502774)
Backed out changeset 07648e9d8400 (bug 1502774)
Backed out changeset b403c3c786ee (bug 1502774)

--HG--
rename : extensions/auth/nsIAuthModule.cpp => extensions/auth/nsAuthFactory.cpp
2018-10-29 17:01:21 +02:00
Ehsan Akhgari
acc9a12f81 Bug 1502774 - Part 2: Remove XPCOM component registrations for auth module classes r=valentin
Depends on D10025

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

--HG--
extra : moz-landing-system : lando
2018-10-29 14:40:29 +00:00
Ehsan Akhgari
7a780d8462 Bug 1502774 - Part 1: Remove XPCOM component registrations for HTTP authenticator classes r=valentin
Differential Revision: https://phabricator.services.mozilla.com/D10025

--HG--
extra : moz-landing-system : lando
2018-10-29 14:40:29 +00:00
Tom Ritter
8b356d2846 Bug 1432429 - Create a DelayHttpChannelQueue class to queue network requests until FuzzyFox indicates they should fire. r=mayhemer,baku 2018-09-18 13:05:54 -05:00
Nicholas Hurley
7ce9475d3c Bug 1496611 - Send NO_ERROR when closing h2 session at shutdown. r=dragana
Previously, we were sending INTERNAL_ERROR, but that's not really true. Firefox hasn't hit an error, we're just shutting down. It makes more sense to tell the peer we're not messed up, just going away nicely.

Depends on D8437

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

--HG--
extra : moz-landing-system : lando
2018-10-25 20:47:19 +00:00
Nicholas Hurley
a2d8c9ef38 Bug 1355858 - Blacklist hosts from spdy who are very poorly behaved. r=dragana
In certain cases (such as the case from bug 1050329, where a server claims to speak h2, but really doesn't), we will end up trying every connection to that server as h2 before falling back to http/1.1. Once we know a server is very badly behaved, it doesn't make sense to keep trying h2 (at least for the current browsing session). This adds an in-memory blacklist of origins & conninfos to not try h2 on, so we don't waste round trips trying h2, failing, and then dialing back with http/1.1 except for the first connection to an origin.

Depends on D8436

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

--HG--
extra : moz-landing-system : lando
2018-10-25 20:52:59 +00:00
Nicholas Hurley
2319ff8d81 Bug 1050329 - part 2 - Add error page for h2 goaway. r=dragana,bzbarsky
This is kind of like the previous patch (where we had a not-very-friendly user experience shutting down misbehaving h2 sessions), but in this case the server has proven to us that it can speak a minimum of h2, so we don't want to just fallback. Instead, when we send a GOAWAY frame because we have detected some error on the part of the server, if it's a top-level page load, we'll show an error page explaining that the server spoke bad http/2, and the site admin(s) need to be contacted. We already did this for INADEQUATE_SECURITY (which is its own special case still), but that didn't cover all the cases.

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

--HG--
extra : moz-landing-system : lando
2018-10-25 20:46:46 +00:00
Nicholas Hurley
669d078042 Bug 1050329 - part 1 - Re-start transactions on totally busted h2 sessions. r=francois,dragana
Previously, we would just let these fail. But, when a peer claims to speak h2 via ALPN, and then plainly doesn't speak h2 (by not doing the opening handshake properly), we should re-try any transactions dispatched to that session using http/1.1 only. No use in giving the user a horrible experience. We will also collect telemetry on how often we have sessions where this happens, so we can see how big of a problem this is (and thus if we need to do any kind of outreach).

Depends on D8432

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

--HG--
extra : moz-landing-system : lando
2018-10-25 20:46:24 +00:00
Nicholas Hurley
1bbb1ab938 Bug 1050329 - (prereq) Make RETURN_SESSION_ERROR a method. r=dragana
Previously this was a macro, but in later patches in this series, I want to make the macro a bit smarter. There's no particular need to have it as a macro (and macros that return from functions are often considered no-nos), so this makes it a method on the session, instead.

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

--HG--
extra : moz-landing-system : lando
2018-10-25 20:46:01 +00:00
Andrea Marchesini
c78617e1a8 Bug 1499995 - part 2 - TrackingDummyChannel must expose nsIHttpChannelInternal, r=ehsan, r=mayhemer 2018-10-25 10:44:12 +02:00
Junior Hsu
ced59fc1ad Bug 1498434 - add new telemetry probe to know the delay caused by e10s back pressure r=valentin
a straight forward implementation

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

--HG--
extra : moz-landing-system : lando
2018-10-23 22:17:22 +00:00
Junior Hsu
8f2bbcfceb Bug 1487559 - add new telemetry probe for the mime type causing suspension for back pressure r=francois,valentin
Differential Revision: https://phabricator.services.mozilla.com/D4729

--HG--
extra : moz-landing-system : lando
2018-10-24 16:26:19 +00:00
Ehsan Akhgari
229b1144b8 Bug 1501404 - Part 5: Remove the XPCOM registration for nsSocketProviderService r=valentin
Depends on D9573

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

--HG--
extra : moz-landing-system : lando
2018-10-23 20:07:25 +00:00
Ehsan Akhgari
e6c5cd6e52 Bug 1501404 - Part 1: Remove the XPCOM registration for RequestContextService r=valentin
Differential Revision: https://phabricator.services.mozilla.com/D9570

--HG--
extra : moz-landing-system : lando
2018-10-23 20:07:17 +00:00
Andrea Marchesini
4ebf5b4364 Bug 1496581 - Split nsISeekableStream in 2 classes: nsISeekableStream and nsITellableStream, f=mayhemer, r=froydnj
In the current code there are 3 main issues:

1. nsFileStream is not really thread-safe. There is nothing to protect the
internal members and we see crashes.

2. nsPipeInputStream doesn't implement ::Seek() method and that caused issues
in devtools when a nsHttpChannel sends POST data using a pipe. In order to fix
this, bug 1494176 added a check in nsHttpChannel: if the stream doesn't
implement ::Seek(), let's clone it. This was an hack around nsPipeInputStream,
and it's bad.

3. When nsHttpChannel sends POST data using a file stream, nsFileStream does
I/O on main-thread because of the issue 2. Plus, ::Seek() is called on the
main-thread causing issue 1.

Note that nsPipeInputStream implements only ::Tell(), of the nsISeekableStream
methods. It doesn't implement ::Seek() and it doesn't implement ::SetEOF().

With this patch I want to fix point 2 and point 3 (and consequentially issue 1
- but we need a separate fix for it - follow up). The patch does:

1. it splits nsISeekableStream in 2 interfaces: nsITellableStream and
nsISeekableStream.
2. nsPipeInputStream implements only nsITellableStream.  Doing this, we don't
need the ::Seek() check for point 2 in nsHttpChannel: a simple QI check is
enough.
3. Because we don't call ::Seek() in nsHttpChannel, nsFileStream doesn't do I/O
on the main-thread, and we don't crash doing so.
2018-10-18 13:35:35 +02:00
Valentin Gosu
055117366d Bug 1487100 - Allow opening the input stream for original content when alt-data is available r=michal,luke
In trying to use fetch with alt-data, we sometimes want the benefit of using alt-data but the JS consumer actually needs to use the original HTTP response from the server.
To get around this problem, we introduce a new API - nsICacheInfoChannel.getOriginalInputStream(nsIInputStreamReceiver) that asyncly receives the input stream containing the HTTP response in the cache entry.

Depends on D8071

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

--HG--
extra : rebase_source : 43d92c631b964c52b551a700b0954276e91695d6
extra : source : 7f9d03c29a6ffd82c1b5e17c14e27a2ae9d64434
2018-10-17 12:27:37 +00: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
324f3ccf9b Bug 1487100 - Allow opening the input stream for original content when alt-data is available r=michal,luke
In trying to use fetch with alt-data, we sometimes want the benefit of using alt-data but the JS consumer actually needs to use the original HTTP response from the server.
To get around this problem, we introduce a new API - nsICacheInfoChannel.getOriginalInputStream(nsIInputStreamReceiver) that asyncly receives the input stream containing the HTTP response in the cache entry.

Depends on D8071

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

--HG--
extra : moz-landing-system : lando
2018-10-17 12:27:37 +00: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
Nicholas Hurley
89b6e4de4b Bug 1499149 - Better telemetry for alt-svc headers seen in the wild. r=francois,valentin
Right now, we have no idea how often an origin may offer us multiple alt-svc options. As we are considering racing multiple alt-svc connections (if they're available), it would be good to know how often we actually have (or would have, were we to store them) multiple options available. It would also be good to know how often an origin may change the target of its alt-svc mapping (even if there is only one target), as changes in target may make it useful to store/race multiple targets, as well.

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

--HG--
extra : moz-landing-system : lando
2018-10-17 18:14:56 +00:00
Nicholas Hurley
2a0345cbb3 Bug 1493724 - Don't overwrite still-valid altsvc mappings until a new one is validated. r=valentin
Right now, as soon as we receive an alt-svc header or frame for an origin, we will overwrite any mapping we already have for that origin, even if it's still valid. This means that, should validation fail for the new mapping, we will have blown away a perfectly usable alt-svc mapping for no good reason. This patch prevents us from overwriting until we know the new mapping is good.

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

--HG--
extra : moz-landing-system : lando
2018-10-15 21:52:04 +00:00
Thomas Wisniewski
ddc2cf9606 Bug 1496577 - have OPTIONS preflights inherit the original request's referrer and referrer policy; r=ckerschb
OPTIONS preflights inherit the original request's referrer and referrer policy

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

--HG--
extra : moz-landing-system : lando
2018-10-12 20:05:10 +00:00
Sylvestre Ledru
dd5741407b Bug 1498586 - Add clang-format off to avoid the reformatting of the data structures r=Ehsan
Too hard/impossible for the tool to format correctly these structs

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

--HG--
extra : moz-landing-system : lando
2018-10-12 20:48:24 +00:00
Andrea Marchesini
dc8ad03720 Bug 1495285 - Introduce TrackingDummyChannel to annotate channels before being intercepted by ServiceWorkers, r=francois, r=mayhemer, f=asuth 2018-10-12 11:40:36 +02:00
Chris Peterson
e70234b350 Bug 583181 - Part 2: Add separate definitions for LEGACY_BUILD_ID and LEGACY_UA_GECKO_TRAIL. r=hsivonen
"Gecko trail" is the term used by MDN [1] for the YYYMMDD build date in the UA string's "Gecko/" token. Build ID is a YYYYMMDDHHMMSS build timestamp. Use LEGACY_BUILD_ID to spoof navigator.buildID. Use LEGACY_UA_GECKO_TRAIL to construct the UA string.

[1] https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/User-Agent/Firefox

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

--HG--
extra : rebase_source : e2a4d7579d419046f0bad6290078f9a652a770d8
extra : source : 8a26c8598528722a8920513c7fdfea40aefe0dbc
2018-10-01 21:27:34 -07:00
Jonathan Kingston
d8f6d455e1 Bug 1461930 - Replace use of speculativeConnect methods for variants that pass a triggeringPrincipal. r=ckerschb
Differential Revision: https://phabricator.services.mozilla.com/D7701

--HG--
extra : moz-landing-system : lando
2018-10-05 13:42:37 +00:00
Nicholas Hurley
9c55ffd196 Bug 1492524. r=dragana
Differential Revision: https://phabricator.services.mozilla.com/D6946

--HG--
extra : rebase_source : bfbdf5f73d83d6c0465a58fc1f9eb4018a308d78
2018-10-08 06:44:42 -04:00
Junior Hsu
fe777f8462 Bug 1494133 - know how many localhosts suspended by e10s back pressure r=valentin
Differential Revision: https://phabricator.services.mozilla.com/D7142

--HG--
extra : moz-landing-system : lando
2018-10-05 21:40:23 +00:00
Csoregi Natalia
9d55d83f31 Merge inbound to mozilla-central. a=merge 2018-10-05 01:29:38 +03:00
Honza Bambas
aba7b477ef Bug 1494376 - Log ~HttpChannelParentListener, r=nwgh 2018-10-04 04:48:00 +03:00
Nicholas Hurley
dad8d53ed9 Bug 1496224 - Followup to 1409570 - fix clang-tidy complaint r=bagder
Differential Revision: https://phabricator.services.mozilla.com/D7652

--HG--
extra : moz-landing-system : lando
2018-10-04 08:43:54 +00:00