Commit Graph

7019 Commits

Author SHA1 Message Date
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
Noemi Erli
8bb8254a13 Merge inbound to mozilla-central. a=merge 2018-10-04 07:03:25 +03:00
Nicholas Hurley
44ca650a2b Bug 1493204 - Add pushed streams to the priority tree. r=dragana
Previously, we had not put pushed streams in the priority tree, we just
let them be top-level items in the tree. With this change, we will put
them into the tree initially based on the priority of the associated
stream. The only exception is if the associated stream is either a
Leader or Urgent Start (in which case, we will turn the pushed streams
into followers).

Once the pushed stream is matched with a request generated by gecko,
that pushed stream will be re-prioritized based on the priority gecko
has for the request, just like a regular pulled stream.

This also allows us to re-prioritize pushed streams into the background
on tab switch (we assume that, before they are matched, they belong to
the same window as the associated stream).

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

--HG--
extra : moz-landing-system : lando
2018-10-03 09:40:23 +00:00
Gurzau Raul
ede1418858 Merge mozilla-central to inbound. a=merge CLOSED TREE 2018-10-02 19:08:39 +03:00
Andrew McCreight
837f0af066 Bug 1493737 - Fix many trivial calls to do_QueryInterface r=smaug
If class A is derived from class B, then an instance of class A can be
converted to B via a static cast, so a slower QI is not needed.

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

--HG--
extra : moz-landing-system : lando
2018-10-01 21:38:01 +00:00
Nicholas Hurley
a3fcc3c708 Bug 1409570 - Ensure that transactions matched with http/2 pushed streams are properly finished. r=bagder
There was an earlier fix to this, that fixed part of the issue, but that
fix was racy. In the case where the transaction was matched with the
pushed stream before the pushed stream received its END_STREAM, and the
response headers did not include a content-length, the transaction would
never notice that the data was done being sent. When that transaction
was necessary for the load event to fire, the page would get stuck in
the loading state until the user explicitly cancelled.

This new patch ensures that the transaction will notice the EOS by
making sure the pushed stream gets inserted into the list of push
streams with data in the case described above. (The previous patch,
which is still in the tree, is still necessary, but not sufficient, to
fix the issue.)

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

--HG--
extra : moz-landing-system : lando
2018-10-01 21:52:57 +00:00
Honza Bambas
2e4f8908ef Bug 1495180 - Add linking LOG to Http2PushedStream::SetConsumerStream. r=nwgh 2018-09-29 01:10:00 +03:00
Francois Marier
eb27c3267c Bug 1488974 - Disable FastBlock after the load event has fired. r=mayhemer,Ehsan
The test used to assume that the load event didn't matter and so
the expected values had to be updated to match the new behavior.

A new "slowIFrame" test was added to capture what was previously
tested by the "badIFrame".

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

--HG--
extra : moz-landing-system : lando
2018-09-28 19:12:10 +00:00
Gijs Kruitbosch
76afb51661 Bug 1493655 - make nsISecureBrowserUI initialize from a docshell instead of a window, r=keeler,nika
This also removes the (afaict, unused) stub implementation from TabParent. The netwerk header
inclusions were necessary because those files included TabParent.h and through it,
nsISecureBrowserUI, but now TabParent.h no longer does that.

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

--HG--
extra : moz-landing-system : lando
2018-09-26 17:48:38 +00:00
Ehsan Akhgari
94133b9360 Bug 1488305 - Remove the XPCOM component registration for BackgroundChannelRegistrar r=nwgh
Differential Revision: https://phabricator.services.mozilla.com/D4893

--HG--
extra : moz-landing-system : lando
2018-09-26 00:27:32 +00:00
Henri Sivonen
3a8d018880 Bug 1487398 - Remove useless use of SetCapacity(). r=froydnj,nwgh
Remove various calls to SetCapacity() that fall into various misuse categories:

 1) Mistakenly believing that the caller should advice the string about zero
    terminator.
 2) Cases where a single append does the right computation on its own.
 3) Calling SetCapacity() with a constant when the string is self-allocated
    and could be an nsAuto[C]StringN and the string doesn't get passed on
    in a way that could benefit from a heap-allocated buffer.
 4) Calling SetCapacity() before assigning a shared buffer to the string.
 5) Calling SetCapacity() before calling a function that will either calls
    SetLength() anyway or calls Adopt().

MozReview-Commit-ID: IKjfl5gLmcD

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

--HG--
extra : moz-landing-system : lando
2018-09-25 15:36:31 +00:00
Kershaw Chang
dc8eeee6b9 Bug 1490235 - Use nsDependentCSubstring in AltDataOutputStreamChild::WriteDataInChunks r=mayhemer
Simply replace the nsCString with nsDependentCSubstring to avoid copying the data. In this way, we can also avoid the potential OOM crash.

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

--HG--
extra : moz-landing-system : lando
2018-09-25 16:56:16 +00:00
Christoph Kerschbaumer
60e3239dee Bug 1490874: Log Principal based Security Errors to the Security pane in the console. r=smaug 2018-09-25 07:25:05 +02:00
Nicholas Hurley
d17d1224fd Bug 1492484 - Do not reprioritize pushed streams on tab switch. r=kershaw
Right now, pushed streams don't get put in the priority hierarchy
anyway, and with the code as it was, we were sending an illegal PRIORITY
frame for stream 0. This prevents that from happening. We should
probably think about putting pushed streams in the priority hierarchy at
some point.

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

--HG--
extra : moz-landing-system : lando
2018-09-24 15:16:22 +00:00
Dragana Damjanovic
9cadc84486 Bug 1473736 - Implement necko part of ESNI r=mak,kmag,mcmanus
--HG--
extra : rebase_source : be79870960953ef9535ccb6a440515ec4a8232d5
extra : histedit_source : 8096ab2eaf246cbbeb97bace0531b86b8c69ff66
2018-09-22 23:54:11 +03:00
Nathan Froyd
b500bde65b Bug 1492894 - part 2 - eliminate already_AddRefed variables in netwerk/; r=valentin
We need to disallow these to fix our static analysis, which should have
already been disallowing them.
2018-09-21 16:45:49 -04:00
Andrea Marchesini
165f1339fd Bug 1494176 - nsHttpChannel must clone the upload stream if it doesn't implement ::Seek(), r=mayhemer 2018-10-03 22:51:55 +02:00
Haik Aftandilian
7ab87f4f35 Bug 1443748 - Delete resolver on main thread. r=jld
--HG--
extra : rebase_source : ddf4e02da4807f4e457573de3fc55a21374445ee
2018-09-13 10:10:52 -07:00
Bogdan Tara
0a366c8ced Merge mozilla-central to autoland. a=merge CLOSED TREE 2018-09-20 07:15:43 +03:00
Ehsan Akhgari
bb5a089b38 Bug 1489624 - Ensure that the Necko cache will only be partitioned for third-party tracker resources r=mayhemer
Differential Revision: https://phabricator.services.mozilla.com/D6281

--HG--
extra : moz-landing-system : lando
2018-09-20 01:17:36 +00:00
Kris Maglione
c7df4b83d7 Bug 1486147: Follow-up: Fix missing QueryInterface entries. r=bustage
--HG--
extra : rebase_source : 4ab19b5145117f9c9aef87d8d59ad7ff923e299d
2018-09-19 17:34:10 -07:00
Randell Jesup
b880eea7c8 Bug 1490963: Make main-process network START markers match STOP markers r=mayhemer 2018-09-19 15:40:41 -04:00
Kris Maglione
31cf107646 Bug 1486147: Part 1 - Add JS iterator support to nsIStringEnumerator. r=mccr8
Differential Revision: https://phabricator.services.mozilla.com/D4269

--HG--
extra : rebase_source : 5fe9d4c7717d65e1bc8d45bdd89bcc5384c6d0ee
extra : histedit_source : e8f5606a192f13524996faf2e179d2c2e58c933f%2C725c8f145a1f4d34f84e6818b61ec5b955862e70
2018-08-24 16:21:33 -07:00
Ehsan Akhgari
d3787265b1 Bug 1489252 - Part 2: Add a telemetry probe for measuring the rate at which popular analytics providers get blocked by fastblock for top-level documents; r=baku,mayhemer,chutten data-r=liuche
Differential Revision: https://phabricator.services.mozilla.com/D5296
2018-09-14 16:06:07 -04:00
Ehsan Akhgari
2012a895a1 Bug 1489252 - Part 1: Move browser.fastblock.enabled to StaticPrefList.h; r=baku
Differential Revision: https://phabricator.services.mozilla.com/D5295
2018-09-14 16:06:07 -04:00
Chris Peterson
77fbb409c9 Bug 1490575 - netwerk: Remove #ifdef MOZ_MULET. r=dragana
Mulet was a Firefox OS simulator that is no longer supported: https://wiki.mozilla.org/Mulet

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

--HG--
extra : rebase_source : e6dd0146f4564e4ea8aa1ce4eaa78e1cfeb421b2
extra : source : 9e3cd534394c0e08ad8fdaa46ac7559a66a09a6b
2018-09-11 23:09:09 -07:00
Dana Keeler
364a010e05 bug 748809 - remove nsIAssociatedContentSecurity and nsISecurityInfoProvider r=mayhemer,jrmuizel
nsIAssociatedContentSecurity and nsISecurityInfoProvider are unused as of
bug 832834, so this patch removes them.

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

--HG--
extra : moz-landing-system : lando
2018-09-13 17:13:43 +00:00
Liang-Heng Chen
ac54284832 Bug 1477046 - Part 1: Add basic FastBlock automation tests; r=mayhemer
Basic parts of FastBlock tests, no iframe/xhr tests in this patch.

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

--HG--
extra : moz-landing-system : lando
2018-09-13 21:27:54 +00:00
Andreea Pavel
c5abbc4085 Backed out changeset d965284aca14 (bug 1477046) for failing toolkit/components/url-classifier/tests/mochitest/test_fastblock_bug1477046.htm 2018-09-13 19:31:32 +03:00
Daniel Stenberg
f55cab35f3 bug 1486137 - fix the stream ID check when counting TRR streams r=nwgh
MozReview-Commit-ID: DzOu1dRlWtg

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

--HG--
extra : moz-landing-system : lando
2018-09-13 14:48:46 +00:00
Liang-Heng Chen
50f5257561 Bug 1477046 - Part 1: Add basic FastBlock automation tests; r=mayhemer
Basic parts of FastBlock tests, no iframe/xhr tests in this patch.

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

--HG--
extra : moz-landing-system : lando
2018-09-13 15:07:07 +00:00
Andreea Pavel
687137ac36 Backed out 2 changesets (bug 1477046) for failing eslint on a CLOSED TREE
Backed out changeset dcbe562ce87a (bug 1477046)
Backed out changeset 757bbd2e3176 (bug 1477046)
2018-09-13 15:22:19 +03:00
Liang-Heng Chen
e8e0348d20 Bug 1477046 - Part 1: Add basic FastBlock automation tests; r=mayhemer
Basic parts of FastBlock tests, no iframe/xhr tests in this patch.

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

--HG--
extra : moz-landing-system : lando
2018-09-13 12:03:41 +00:00
Francois Marier
947b258b04 Bug 1488951 - Put a limit on how long FastBlock runs. r=mayhemer,Ehsan. CLOSED TREE
Differential Revision: https://phabricator.services.mozilla.com/D5098

--HG--
extra : source : e97cfb1a3f88d0e76e4dfd665aa5f7713881558a
extra : amend_source : 905f3af0cf7a94014d41734f66eea4bfc2c5e15e
2018-09-11 18:17:12 +00:00
Narcis Beleuzu
3c3da81ebc Backed out changeset e97cfb1a3f88 (bug 1488951) by bhearsum`s request. 2018-09-11 22:01:36 +03:00
Francois Marier
e1f72beb97 Bug 1488951 - Put a limit on how long FastBlock runs. r=mayhemer,Ehsan
Differential Revision: https://phabricator.services.mozilla.com/D5098

--HG--
extra : moz-landing-system : lando
2018-09-11 18:17:12 +00:00
Honza Bambas
7ca705dba4 Bug 1488039 - Don't log cancelled CORS requests as errors, r=ckerschb
Differential Revision: https://phabricator.services.mozilla.com/D4855

--HG--
extra : moz-landing-system : lando
2018-09-04 11:20:57 +00:00
Dipen Patel
aeed887ff8 Bug 1468222 Consolidate nsISSLStatus info nsITransportSecurityInfo r=Gijs,snorp,jcj,mcmanus,sfraser,keeler,baku,ato
Move all fields of nsISSLStatus to nsITransportSecurityProvider
Remove nsISSLStatus interface and definition
Update all code and test references to nsISSLStatus
Maintain ability to read in older version of serialized nsISSLStatus.  This
is verified with psm_DeserializeCert gtest.

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

--HG--
extra : moz-landing-system : lando
2018-09-11 00:07:30 +00:00
Daniel Varga
9e7995b3c3 Merge mozilla-inbound to mozilla-central. a=merge 2018-09-10 19:14:55 +03:00
Ehsan Akhgari
645a5d3db1 Bug 1489916 - Remove the XPCOM component registration for nsHttpChannelAuthProvider; r=valentin
Differential Revision: https://phabricator.services.mozilla.com/D5390
2018-09-10 08:01:37 -04:00
Valentin Gosu
d3db9b2ceb Bug 1489730 - Allow base64 token to be followed by space r=hsivonen
Differential Revision: https://phabricator.services.mozilla.com/D5378

--HG--
extra : moz-landing-system : lando
2018-09-10 06:24:20 +00:00
Csoregi Natalia
0400fe7b57 Backed out changeset bd8baf88f373 (bug 1468222) for test_security-info-parser.js failures. CLOSED TREE 2018-09-08 03:16:25 +03:00
Dipen Patel
0679e09a9a Bug 1468222 Consolidate nsISSLStatus info nsITransportSecurityInfo r=snorp,ato,sfraser,keeler,baku,mcmanus,Gijs
Move all fields of nsISSLStatus to nsITransportSecurityProvider
Remove nsISSLStatus interface and definition
Update all code and test references to nsISSLStatus
Maintain ability to read in older version of serialized nsISSLStatus.  This
is verified with psm_DeserializeCert gtest.

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

--HG--
extra : moz-landing-system : lando
2018-09-07 22:50:17 +00:00
Sylvestre Ledru
aa37bde79b Bug 1489454 - Remove all trailing whitespaces (again) r=Ehsan
This also includes moving some files to the regular format.

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

--HG--
extra : moz-landing-system : lando
2018-09-07 14:47:51 +00:00
Valentin Gosu
b39f149d13 Bug 908413 - Use dom::CMimeType::Parse to extract content type for data URIs r=hsivonen
Depends on D5094

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

--HG--
extra : moz-landing-system : lando
2018-09-07 05:44:49 +00:00
Nicholas Hurley
dc19891fc2 Bug 1485019 - Don't Truncate() a pre-allocated decompression buffer. r=dragana
Differential Revision: https://phabricator.services.mozilla.com/D5044

--HG--
extra : moz-landing-system : lando
2018-09-06 21:05:03 +00:00
Valentin Gosu
4c346828a4 Bug 1481084 - Assertion OnSocketThread() in HttpBackgroundChannelChild::RecvOnStopRequest during shutdown r=dragana
OnSocketTread doesn't work properly during shutdown because nsSocketTransportService2.cpp::gSocketThread is null.
We call gSocketTransportService->IsOnCurrentThreadInfallible() instead, just like we already do in HttpBackgroundChannelChild::ActorDestroy()

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

--HG--
extra : moz-landing-system : lando
2018-09-06 21:03:10 +00:00
Valentin Gosu
a2675e9878 Bug 1476996 - Implement cross process redirection in Http on the parent process r=bagder,nika
This patch builds the foundation for the ability to relocate HTTP channels from one content process to another in order to ensure that origins are properly isolated. This relocation would normally occur when the response to an HTTP request is a redirect to a different origin.
The patch merely adds the mechanism for relocating the channel, rather than the logic of doing so. This will be provided in a follow-up patch by a specialized service. Right now that functionality is mocked in the test.

How this works:
In nsHttpChannel::OnStartRequest we will query the service that decides whether we need to direct the response to another process. If so, it will return a promise that resolves to a TabParent.
When the promise resolves, in HttpChannelParentListener::TriggerCrossProcessRedirect we call NeckoParent::SendCrossProcessRedirect passing along the required information to recreate the channel in the new process. The NeckoChild in the new process will then instantiate a new channel, call ConnectParent() which creates the associated parent channel, and connects it with the existing nsHttpChannel.
A listener in the new process is then notified of the existence of the new channel. It is required to call completeRedirectSetup on the channel, passing an nsIStreamListener to the call.
We then finish the entire operation with a call to HttpChannelChild::SendCrossProcessRedirectDone which causes us to close the old HttpChannelChild in the previous process and to resume the nsHttpChannel in the main process.

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

--HG--
rename : netwerk/test/browser/browser_cookie_sync_across_tabs.js => netwerk/test/browser/browser_cross_process_redirect.js
rename : dom/media/test/redirect.sjs => netwerk/test/browser/redirect.sjs
extra : moz-landing-system : lando
2018-09-04 20:45:22 +00:00
Gurzau Raul
dfbefcc19f Backed out changeset 45605798ecfe (bug 1476996) for build bustage at netwerk/protocol/http/HttpChannelParentListener.cpp on a CLOSED TREE 2018-09-04 20:31:33 +03:00
Valentin Gosu
98ff61cc44 Bug 1476996 - Implement cross process redirection in Http on the parent process r=bagder,nika
This patch builds the foundation for the ability to relocate HTTP channels from one content process to another in order to ensure that origins are properly isolated. This relocation would normally occur when the response to an HTTP request is a redirect to a different origin.
The patch merely adds the mechanism for relocating the channel, rather than the logic of doing so. This will be provided in a follow-up patch by a specialized service. Right now that functionality is mocked in the test.

How this works:
In nsHttpChannel::OnStartRequest we will query the service that decides whether we need to direct the response to another process. If so, it will return a promise that resolves to a TabParent.
When the promise resolves, in HttpChannelParentListener::TriggerCrossProcessRedirect we call NeckoParent::SendCrossProcessRedirect passing along the required information to recreate the channel in the new process. The NeckoChild in the new process will then instantiate a new channel, call ConnectParent() which creates the associated parent channel, and connects it with the existing nsHttpChannel.
A listener in the new process is then notified of the existence of the new channel. It is required to call completeRedirectSetup on the channel, passing an nsIStreamListener to the call.
We then finish the entire operation with a call to HttpChannelChild::SendCrossProcessRedirectDone which causes us to close the old HttpChannelChild in the previous process and to resume the nsHttpChannel in the main process.

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

--HG--
rename : netwerk/test/browser/browser_cookie_sync_across_tabs.js => netwerk/test/browser/browser_cross_process_redirect.js
rename : dom/media/test/redirect.sjs => netwerk/test/browser/redirect.sjs
extra : moz-landing-system : lando
2018-09-04 16:40:57 +00:00
Ehsan Akhgari
92bbdcda2d Bug 1488238 - Remove the XPCOM component registration for nsApplicationCache; r=valentin
Differential Revision: https://phabricator.services.mozilla.com/D4878
2018-09-03 14:01:03 -04:00
Sebastian Hengst
973b725f51 Bug 1485400 - Remove ')' from merge conflict. a=bustage-fix 2018-09-01 01:56:12 +03:00
Ciure Andrei
d1376bd7ec Merge inbound to mozilla-central. a=merge 2018-09-01 01:40:48 +03:00
Coroiu Cristina
83cdfe7284 Merge mozilla-central to inbound a=merge on a CLOSED TREE 2018-08-31 19:35:06 +03:00
Coroiu Cristina
43969de34f Merge inbound to mozilla-central a=merge 2018-08-31 19:14:43 +03:00
Andrea Marchesini
155c458ccc Bug 1487390 - Notify when a channel is aborted because of fastblocking, r=ehsan 2018-08-31 11:02:33 +02:00
Andrea Marchesini
40a8c122d3 Bug 1487331 - STATE_BLOCKED_TRACKING_COOKIES must tell why cookies are blocked, r=ehsan
Introduce these new blocking state values:

const unsigned long STATE_COOKIES_BLOCKED_BY_PERMISSION = 0x10000000;
const unsigned long STATE_COOKIES_BLOCKED_TRACKER       = 0x20000000;
const unsigned long STATE_COOKIES_BLOCKED_ALL           = 0x40000000;
const unsigned long STATE_COOKIES_BLOCKED_FOREIGN       = 0x80000000;
2018-08-31 11:02:33 +02:00
Coroiu Cristina
71432717b8 Merge mozilla-central to autoland a=merge on a CLOSED TREE 2018-08-31 19:18:33 +03:00
Liang-Heng Chen
7206b4243b Bug 1485400 - Part 1: fix tracker found/blocked counter; r=mayhemer
make counter increased when trackers are found

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

--HG--
extra : rebase_source : 90da79fbb83271b2f7a8460ebd02aa2abb635305
extra : source : c476aa79a8ca991dc8ea1e5c2eab98e442dad406
2018-08-31 15:13:30 +00:00
Coroiu Cristina
437a1f4445 Backed out 2 changesets (bug 1485400) for build bustage at build/src/netwerk/base/nsChannelClassifier.cpp on a CLOSED TREE
Backed out changeset c476aa79a8ca (bug 1485400)
Backed out changeset 9370432b26ad (bug 1485400)
2018-08-31 18:57:58 +03:00
Liang-Heng Chen
64e65f4ec9 Bug 1485400 - Part 1: fix tracker found/blocked counter; r=mayhemer
make counter increased when trackers are found

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

--HG--
extra : moz-landing-system : lando
2018-08-31 15:13:30 +00:00
Daniel Stenberg
7f94897d33 bug 1487432 - make LOAD_DISABLE_TRR enforce a different hashkey r=valentin
so that such requests don't inadvertently reuse connections done that
might have used TRR.

MozReview-Commit-ID: 2bO4VCGSgOO

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

--HG--
extra : moz-landing-system : lando
2018-08-31 07:03:16 +00:00
Andrea Marchesini
24005dab5f Bug 1485492 - Disable fastblocking when the user has interacted with a document, r=ehsan 2018-08-31 13:21:17 +02:00
Andrea Marchesini
45cfa7f75c Bug 1487093 - Propagate cookie blocking notification to child nsIChannel, r=ehsan, r=valentin 2018-08-30 17:44:39 +02:00
Cosmin Sabou
2731d11658 Merge mozilla-central to inbound. a=merge 2018-10-04 02:40:08 +03:00
Honza Bambas
b730d24d2e yBug 1423278 - Correctly instantiate proxy authenticator with a lowercase schema, r=jduell
--HG--
extra : rebase_source : 7b64c728e296db8242cde7dff57aa60b903dc29d
2018-08-29 14:04:00 +03:00
Henri Sivonen
f725924171 Bug 1485943 - Avoid writing past the logical length of a string in AlternateServices.cpp. r=dragana
MozReview-Commit-ID: 4xPYaAbGaEI

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

--HG--
extra : moz-landing-system : lando
2018-08-29 08:39:42 +00:00
Ciure Andrei
d716a04e20 Merge inbound to mozilla-central. a=merge 2018-08-29 00:58:21 +03:00
Nicholas Hurley
dd1853e164 Bug 1483294 - Always advertise h2 if TLS 1.3 is being offered. r=dragana
Previously (under TLS 1.2), we would avoid advertising h2 support if the
spec-mandatory suite was disabled. That suite is only required for TLS
1.2, though. We would like to offer h2 in more cases, so only check for
the mandatory suite if someone has turned off TLS 1.3.

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

--HG--
extra : moz-landing-system : lando
2018-08-27 18:56:44 +00:00
Henri Sivonen
cbab098175 Bug 1485343 - Avoid locale-dependent C standard library functions in FTP code. r=valentin
MozReview-Commit-ID: CXcluPKLwIv

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

--HG--
extra : moz-landing-system : lando
2018-08-27 09:11:30 +00:00
arthur.iakab
5527acb8d8 Merge inbound to mozilla-central a=merge 2018-08-25 01:08:22 +03:00
Henri Sivonen
b1e7ee63f3 Bug 1485945 - Set the length instead of capacity of an address string to avoid writing past its logical length. r=valentin
MozReview-Commit-ID: 5anNIW843JJ

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

--HG--
extra : moz-landing-system : lando
2018-08-24 14:05:13 +00:00
Ehsan Akhgari
9172f9d616 Bug 1485494 - Remove the XPCOM registration for RedirectChannelRegistrar; r=mayhemer 2018-08-24 13:04:10 -04:00
Ehsan Akhgari
50793958bf Bug 1485532 - Part 2: Make sure that tracking requests that webRequest.onBeforeRequest handlers do not handle will still get blocked by tracking protection; r=mayhemer 2018-08-24 11:23:10 -04:00
Ehsan Akhgari
5306437473 Bug 1485673 - Allow tracking channels being redirected from http-on-modify-request observer notifications when tracking protection is turned on; r=mayhemer 2018-08-24 11:23:09 -04:00
Tiberius Oros
2ee9341d01 Merge inbound to mozilla-central. a=merge 2018-08-24 12:43:45 +03:00
Daniel Stenberg
9eb175b4cb bug 1470853 - Add Telemetry::DNS_TRR_REQUEST_PER_CONN r=nwgh
Count number of requests/streams per connection done when the connection
was used for TRR.

MozReview-Commit-ID: 50NVSCcd6jy

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

--HG--
extra : moz-landing-system : lando
2018-08-23 18:13:34 +00:00
Ehsan Akhgari
3efae05d6c Bug 1485427 - Add two assertions ensuring that request observers are (not) fired at the right times; r=mayhemer 2018-08-23 22:59:32 -04:00
Cosmin Sabou
d141575366 Merge mozilla-central to mozilla-inbound. a=merge 2018-08-27 19:00:38 +03:00
Ehsan Akhgari
2d62042b5c Bug 1486092 - Part 1: Move the browser.contentblocking.enabled pref to StaticPrefs; r=baku 2018-08-27 09:22:01 -04:00
Ehsan Akhgari
3788f265e3 Bug 1485182 - Part 1: Run http-on-modify-request observers when tracking protection cancels an HTTP channel; r=mayhemer 2018-08-22 14:00:01 -04:00
Henri Sivonen
57d5f3ee13 Bug 1484984 - Avoid writing past the logical length of a string in networking code. r=valentin
MozReview-Commit-ID: IIffoxnF6KS

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

--HG--
extra : moz-landing-system : lando
2018-08-21 14:20:48 +00:00
Daniel Stenberg
8225a95bbd bug 1483311 - add LOAD_DISABLE_TRR as a loadflag r=mcmanus
Disable TRR at will without needing to toggle the pref.

MozReview-Commit-ID: 1Ept6kDrjN3

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

--HG--
extra : moz-landing-system : lando
2018-08-20 22:02:04 +00:00
Francois Marier
309a23afc3 Bug 1482950 - Use the correct 3rdparty check in tracking annotations. r=dimi,Ehsan,mayhemer!,ehsan!
The mIsTrackingResource flag on nsIHttpChannel was split into two separate
flags depending on whether or not the resource is third-party. The correct
flag will be set by the channel classifier. Similarly, a new function was
introduced, GetIsThirdPartyTrackingResource(), for those consumers (like TP)
who only care about third-party trackers.

The existing function, GetIsTracking(), will continue to look at both
first-party and third-party trackers (the behavior since first party
tracking was added to annotations in bug 1476324).

The OverrideTrackingResource() function now allows nsHTMLDocument to
override both mIsFirstPartyTrackingResource and
mIsThirdPartyTrackingResource, but since this function is a little dangerous
and only has a single user, I added an assert to make future callers think
twice about using it to opt out of tracking annotations.

Currently, only the default storage restrictions need to look at first-party
trackers so every other consumer has been moved to
mIsThirdPartyTrackingResource or GetIsThirdPartyTrackingResource().

This effectively reverts the third-party checks added in bug 1476715 and
replaces them with the more complicated check that was added in bug 1108017.
It follows the approach that Ehsan initially suggested in bug 1476715. It
also reverts the changes in the expected values of the tracking annotation
test since these were, in hindsight, a warning about this regression.

Depends on D3722

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

--HG--
extra : moz-landing-system : lando
2018-08-20 23:53:45 +00:00
Francois Marier
e2c011dd88 Bug 1482950 - Backed out changeset 32d94a3cc7af. r=xeonchen!
This refactoring is now unnecessary since the third-party check
is getting removed.

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

--HG--
extra : moz-landing-system : lando
2018-08-19 09:00:44 +00:00
Brindusan Cristian
edd591c4d4 Backed out changeset 89117b6b5799 (bug 1470853) for xpcshell failures on dom/push/test/xpcshell/test_notification_http2.js. CLOSED TREE 2018-08-20 19:20:20 +03:00
Daniel Stenberg
70b6a3456b bug 1470853 - Add Telemetry::DNS_TRR_REQUEST_PER_CONN r=nwgh
Count number of requests/streams per connection done when the connection
was used for TRR.

MozReview-Commit-ID: H7X06h8gVZY

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

--HG--
extra : moz-landing-system : lando
2018-08-20 15:11:14 +00:00
Liang-Heng Chen
6c9d7c21d6 Bug 1481252 - Part 1: Report FastBlock status to docshell; r=valentin
Differential Revision: https://phabricator.services.mozilla.com/D3024

--HG--
extra : moz-landing-system : lando
2018-08-16 15:29:22 +00:00
Liang-Heng Chen
a0692d51f7 Bug 1482117 - Part 2: cache the result of IsThirdPartyChannel; r=mayhemer
cache the result to speed up

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

--HG--
extra : moz-landing-system : lando
2018-08-17 12:43:51 +00:00
Liang-Heng Chen
837bec1102 Bug 1482117 - Part 1: Make FastBlock happen after tailing; r=mayhemer
move the FastBlock checking block to |TriggerNetwork|

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

--HG--
extra : moz-landing-system : lando
2018-08-15 16:32:34 +00:00
Margareta Eliza Balazs
48299c8cd6 Merge inbound to mozilla-central. a=merge 2018-08-16 12:24:26 +03:00
Junior Hsu
13e7f90bb3 Bug 1280629 - Part 2: telemetry of e10 back pressure suspension rate r=dragana
Split this patch for data review

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

--HG--
extra : moz-landing-system : lando
2018-08-15 22:36:42 +00:00
Junior Hsu
4cd0359acf Bug 1280629 - Part 1: Suspend the http channel if the child process is not able to consume on time r=dragana
Differential Revision: https://phabricator.services.mozilla.com/D2745

--HG--
extra : moz-landing-system : lando
2018-08-15 22:35:58 +00:00
Diego Pino Garcia
6895fb936e Bug 1405022 - Remove unnecessary use of nsAutoCString from the call to NS_NewURI in nsViewSourceChannel::BuildViewSourceURI. r=mayhemer 2018-08-15 09:02:00 -04:00
Narcis Beleuzu
2c112fd0ac Backed out 2 changesets (bug 1280629) for wpt failures on media-elements/video_008.htm
Backed out changeset 64648fd6ef5e (bug 1280629)
Backed out changeset e654f2b128f6 (bug 1280629)
2018-08-15 19:44:37 +03:00
Junior Hsu
b434505847 Bug 1280629 - Part 2: telemetry of e10 back pressure suspension rate. r=dragana
Summary: Split this patch for data review

Reviewers: dragana

Reviewed By: dragana

Subscribers: janerik

Bug #: 1280629

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

--HG--
extra : amend_source : 16f0ab9d1f12f7e299d1339e3c1ca3023ea8502b
2018-08-15 10:07:04 +03:00
Junior Hsu
c45d80770b Bug 1280629 - Part 1: Suspend the http channel if the child process is not able to consume on time. r=dragana
Reviewers: dragana

Reviewed By: dragana

Subscribers: reviewbot

Bug #: 1280629

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

--HG--
extra : rebase_source : d031d3dcd945e1e479a121c06e5ee0b7dfd75ea9
extra : amend_source : 36f5d5dfb1b6bc29920a8e72f1105def472607fa
2018-08-15 10:04:50 +03:00
Henri Sivonen
3edc601325 Bug 1402247 - Use encoding_rs for XPCOM string encoding conversions. r=Nika,erahm,froydnj.
Correctness improvements:

 * UTF errors are handled safely per spec instead of dangerously truncating
   strings.

 * There are fewer converter implementations.

Performance improvements:

 * The old code did exact buffer length math, which meant doing UTF math twice
   on each input string (once for length calculation and another time for
   conversion). Exact length math is more complicated when handling errors
   properly, which the old code didn't do. The new code does UTF math on the
   string content only once (when converting) but risks allocating more than
   once. There are heuristics in place to lower the probability of
   reallocation in cases where the double math avoidance isn't enough of a
   saving to absorb an allocation and memcpy.

 * Previously, in UTF-16 <-> UTF-8 conversions, an ASCII prefix was optimized
   but a single non-ASCII code point pessimized the rest of the string. The
   new code tries to get back on the fast ASCII path.

 * UTF-16 to Latin1 conversion guarantees less about handling of out-of-range
   input to eliminate an operation from the inner loop on x86/x86_64.

 * When assigning to a pre-existing string, the new code tries to reuse the
   old buffer instead of first releasing the old buffer and then allocating a
   new one.

 * When reallocating from the new code, the memcpy covers only the data that
   is part of the logical length of the old string instead of memcpying the
   whole capacity. (For old callers old excess memcpy behavior is preserved
   due to bogus callers. See bug 1472113.)

 * UTF-8 strings in XPConnect that are in the Latin1 range are passed to
   SpiderMonkey as Latin1.

New features:

 * Conversion between UTF-8 and Latin1 is added in order to enable faster
   future interop between Rust code (or otherwise UTF-8-using code) and text
   node and SpiderMonkey code that uses Latin1.

MozReview-Commit-ID: JaJuExfILM9
2018-08-14 14:43:42 +03:00
Ehsan Akhgari
c64a283779 Bug 1482999 - Use the final channel URI for top-level document loads when determining the unique cache storage space identifier; r=valentin
In some cases, such as for channels which have been opened from the parent
process, the top window URI isn't available.  For such channels, the code
before this change would fail to compute the top window origin.
2018-08-13 18:22:13 -04:00
Daniel Varga
9355025fd5 Merge mozilla-central to mozilla-inbound 2018-08-14 01:09:48 +03:00
Francois Marier
66260f4d22 Bug 1480448 - Honor browser.contentblocking.enabled in Fastblock. r=xeonchen!
Differential Revision: https://phabricator.services.mozilla.com/D3135

--HG--
extra : moz-landing-system : lando
2018-08-13 10:06:37 +00:00
Ehsan Akhgari
9ab3b9fea9 Bug 1478539 - Part 3: Remove some dead code; r=nwgh 2018-08-13 17:05:31 -04:00
Ehsan Akhgari
8f79c3cc07 Bug 1478539 - Part 1: Add the Cookie header to HTTP requests only after a potential classification has been completed on the channel to ensure the tracking state is up to date; r=nwgh
Besides this, we also need to do two extra things here:

  * Call the http-on-modify-request observers after the Cookie header is set,
    to ensure the Cookie header will be visible to them.
  * Move the call to SetLoadGroupUserAgentOverride() to happen after that, in
    order to preserve the existing respective ordering of that with regards to
    when the http-on-modify-request observers run.

Please note that as things are right now, the http-on-modify-request observers
are unable to see the User-Agent header overrides through the loadgroup, which
seems suboptimal, but this patch aims to preserve the existing behavior of
these observers.
2018-08-13 17:04:44 -04:00
Andrea Marchesini
d1e5833a37 Bug 1480780 - Merge the privacy.3rdpartystorage.enabled pref with the network.cookie.cookieBehavior pref; r=ehsan
This patch introduces a new cookie behavior policy called
BEHAVIOR_REJECT_TRACKER.  It also makes it possible to override that
behavior with cookie permissions similar to other cookie behaviors.
2018-08-13 16:01:16 -04:00
Ehsan Akhgari
7d314b5011 Bug 1482129 - Exempt stylesheets, fonts and images when canceling loading of slow HTTP requests of tracking resources; r=valentin 2018-08-09 14:03:10 -04:00
Mike Hommey
01f69bda76 Bug 1481373 - Work around clang miscompilation of a non-virtual thunk to HttpChannelChild::AsyncCall on x86. r=valentin 2018-08-08 06:31:40 +09:00
Kershaw Chang
2e30d83ba2 Bug 1470458 - Use correct function to copy UTF8 string, r=valentin
Since username and password are not always ascii string, we have to use the correct function CopyUTF8toUTF16 to copy string.
2018-08-07 06:00:00 +03:00
Arthur Edelstein
04dab89db7 Bug 1481096 - Fix incorrectly written pref name r=nwgh
"spdy.default-hpack-buffer" was incorrectly
written as "spdy.hpack-default-buffer".

--HG--
extra : histedit_source : 28dfa00e0accb4e51239a2d31178944034b3eaf5
2018-08-05 16:10:00 +03:00
Masatoshi Kimura
3b21b7868b Bug 1090497 - Re-enable warnings as errors on clang-cl. r=froydnj
--HG--
extra : rebase_source : c09366fb93e5b0f72abe1e99d3094e3d96a934fb
extra : intermediate-source : 5950c9d63c3b4fd63a25464a7b50944aaec7079f
extra : source : ca1b9a2bcc4381795f556fea2fb59066567c30f3
2018-07-31 22:10:07 +09:00
Andrea Marchesini
d7df3bf81e Bug 1476715 - low priority connection for 3rd party + tracking resource only, r=francois 2018-08-06 13:42:43 +02:00
Franziskus Kiefer
a52a8495f9 Bug 1479787 - use NSS mozpkix in Firefox, r=mt,keeler,glandium
Differential Revision: https://phabricator.services.mozilla.com/D2725
Differential Revision: https://phabricator.services.mozilla.com/D2860

--HG--
extra : rebase_source : 189c13c2a3104c106fcabad5998af6cb2e20d4a5
2018-10-02 14:59:34 +02:00
Andrea Marchesini
8ab9f07dd8 Bug 1462879 - PerformanceNavigationTiming must be notified correctly - part 1 - notify, r=smaug, r=valentin 2018-08-04 08:54:58 +02:00
Cosmin Sabou
de8c2bd891 Backed out changeset 5950c9d63c3b (bug 1090497) for build bustages on several files. CLOSED TREE 2018-08-02 19:59:53 +03:00
Masatoshi Kimura
feea19030c Bug 1090497 - Re-enable warnings as errors on clang-cl. r=froydnj
--HG--
extra : rebase_source : a62521fdc66def4e4d5d7bf52e68365a786b5c55
extra : source : ca1b9a2bcc4381795f556fea2fb59066567c30f3
2018-07-31 22:10:07 +09:00
Nicholas Hurley
e8cb6c18a3 Bug 1468583 - Explicitly tie h2stream to transaction in logs for logan. r=valentin
Differential Revision: https://phabricator.services.mozilla.com/D1656

--HG--
extra : moz-landing-system : lando
2018-07-27 06:35:00 +00:00
Felipe Gomes
25e4f07d6c Bug 1470324 - Don't load enterprise policies in the content during startup. r=kmag
With this patch, EnterprisePoliciesContent.js will only be loaded whenever a check for isAllowed happens in content.

This patch also adds shortcuts to make sure that checks for about:blank, about:neterror and about:certerror are skipped

MozReview-Commit-ID: AdMrolJqouN

--HG--
extra : rebase_source : 0949427c78fe26743294c0c1b43844f0154003b7
2018-07-27 14:50:55 -03:00
Michal Novotny
6c7074966b Bug 1477684 - rcwn blocking some xmlHttpRequests, r=valentin
Remove conditional and byte range headers when network won the race for case we send the request again due to 401 response.
2018-07-26 07:20:00 +03:00
Dorel Luca
57b8025529 Backed out changeset 3ff805a9631e (bug 1475701) for XPCshell failures on netwerk/test/unit/test_cache2-29a-concurrent_read_resumable_entry_size_zero.js 2018-07-27 12:12:59 +03:00
Michal Novotny
38f29ba537 Bug 1475701 - Save Page As doesn't begin MP3 download while tab is open, r=valentin
We need to close the cache entry if opening output stream for writing/appending data failed, so the entry isn't blocked for other requests.
2018-07-26 14:54:00 +03:00
Eric Rahm
c8e70cc096 Bug 1240547 - Part 5: Reorder HttpBaseChannel member variables. r=valentin
--HG--
extra : rebase_source : af73138c747517bb82658a4a1e9f3cf357db2f91
2018-07-20 16:56:22 -07:00
Eric Rahm
34bd603e7b Bug 1240547 - Part 4: Use bitfields for HttpChannelChild bool variables. r=valentin
--HG--
extra : rebase_source : aaba4d19c433485a711bdabb2907984163bb4ed0
2018-07-20 15:39:40 -07:00
Eric Rahm
4fa3e432dd Bug 1240547 - Part 3: Reorder HttpChannelChild member variables. r=valentin
--HG--
extra : rebase_source : f1c33e1b77f9ce0fd70838ed27331c8490163774
2018-07-20 14:11:46 -07:00
Eric Rahm
a388fe4b0c Bug 1240547 - Part 2: Pack HttpChannelParent bool fields. r=valentin
--HG--
extra : rebase_source : 459cb63075b9a328d70c23b30cc9ca76a4a58162
2018-07-19 17:40:43 -07:00
Eric Rahm
bcf9fc80b0 Bug 1240547 - Part 1: Reorder HttpChannelParent member variables. r=valentin
--HG--
extra : rebase_source : 2e60ea6d39d4e2717edd68e4abd1f06acf8bc7d4
2018-07-19 17:19:07 -07:00