Commit Graph

214 Commits

Author SHA1 Message Date
Andrea Marchesini
a14dfd8e8d Bug 1417463 - Default accept header should follow the fetch spec, r=mayhemer 2019-01-08 23:36:16 +01:00
Emilio Cobos Álvarez
d2ed260822 Bug 1517241 - Rename nsIDocument to mozilla::dom::Document. r=smaug
Summary: Really sorry for the size of the patch. It's mostly automatic
s/nsIDocument/Document/ but I had to fix up in a bunch of places manually to
add the right namespacing and such.

Overall it's not a very interesting patch I think.

nsDocument.cpp turns into Document.cpp, nsIDocument.h into Document.h and
nsIDocumentInlines.h into DocumentInlines.h.

I also changed a bunch of nsCOMPtr usage to RefPtr, but not all of it.

While fixing up some of the bits I also removed some unneeded OwnerDoc() null
checks and such, but I didn't do anything riskier than that.
2019-01-03 17:48:33 +01:00
Andrea Marchesini
f47925dbf9 Bug 1508699 - Fetch() should not send lowercase header names, r=asuth 2018-12-19 15:48:30 +01:00
Andrea Marchesini
1472148116 Bug 1513647 - MutableBlobStorage should be used in eCouldBeInTemporaryFile mode for fetch(), r=smaug 2018-12-19 15:48:29 +01:00
Andrea Marchesini
cdd5a7b12c Bug 1511436 - Cleanup URL-Classifier code - part 0 - use of StaticPrefs, r=dimi 2018-12-14 12:40:16 +01:00
Sylvestre Ledru
265e672179 Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
# ignore-this-changeset

--HG--
extra : amend_source : 4d301d3b0b8711c4692392aa76088ba7fd7d1022
2018-11-30 11:46:48 +01:00
Junior Hsu
6ef3ba21db Bug 1505844 - nullcheck of non-ClassOfService channel in FetchDriver to avoid crash r=mayhemer
Differential Revision: https://phabricator.services.mozilla.com/D12363

--HG--
extra : moz-landing-system : lando
2018-11-28 22:32:32 +00:00
Andrea Marchesini
89f6169d5f Bug 1508661 - origin header should not be set for GET and HEAD requests, r=asuth 2018-11-21 11:33:47 +01: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
Andrea Marchesini
2680372dcf Bug 1501354 - Fetch() should not block the loadgroup from completing, r=bz 2018-10-27 08:55:20 +02:00
Andrea Marchesini
4439acd683 Bug 1498510 - Move nsICSPEventListener out of CSP object, r=ckerschb 2018-10-23 08:17:13 +02: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
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
Thomas Wisniewski
ba1f0dc311 Bug 1496621 - reject Fetch promises with (informative) TypeErrors when decoding fails, per spec; r=baku
reject Fetch promises with (informative) TypeErrors when decoding fails, per spec

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

--HG--
extra : moz-landing-system : lando
2018-10-08 23:57:23 +00:00
Thomas Wisniewski
d23454328e Bug 1491504 - shortcut blob responses from XHR and fetch when the URL is a blob URL; r=baku
shortcut blob responses from XHR and fetch when the URL is a blob URL

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

--HG--
extra : moz-landing-system : lando
2018-10-06 17:34:24 +00:00
Ciure Andrei
47efccbbca Backed out changeset c5ac0cb25238 (bug 1491504) for FetchConsumer.cpp build bustages CLOSED TREE 2018-10-06 02:58:44 +03:00
Thomas Wisniewski
2294c78986 Bug 1491504 - shortcut blob responses from XHR and fetch when the URL is a blob URL; r=baku
shortcut blob responses from XHR and fetch when the URL is a blob URL

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

--HG--
extra : moz-landing-system : lando
2018-10-05 20:23:55 +00:00
Tom Tung
b98b2f6c82 Bug 1486445 - P1 - Propagate the sw internally redirected URL to fetching request; r=asuth
Bug 1222008 didn't propagate a sw redirected URL to outer response properly. To
fix that this patch mainly make a redirecting request be overwritten while it's
redirected by a service worker. This patch also add a private setter function
for InternalRequest and a public checking function to avoid that function from
being used widely.

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

--HG--
extra : moz-landing-system : lando
2018-09-12 12:44:30 +00:00
Thomas Wisniewski
400093bdb6 Bug 1482752 - Have Fetch bodies use File blobs for local files instead of regular blobs. r=baku
Have Fetch bodies use File blobs for local files instead of regular blobs.

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

--HG--
extra : moz-landing-system : lando
2018-09-11 19:13:15 +00:00
Cosmin Sabou
dc72962df3 Backed out changeset 68805212630a (bug 1482752) for causing build bustages on dom/fetch. CLOSED TREE 2018-09-08 20:46:04 +03:00
Thomas Wisniewski
4d92a94c0d Bug 1482752 - Have Fetch bodies use File blobs for local files instead of regular blobs. r=baku
Have Fetch bodies use File blobs for local files instead of regular blobs.

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

--HG--
extra : moz-landing-system : lando
2018-09-08 14:34:37 +00:00
Andrea Marchesini
e1a0b51543 Bug 1478101 - Split AbortSignal in 2 classes: AbortSignal and AbortSignalImpl, r=bz 2018-08-26 14:16:21 +02:00
Thomas Wisniewski
2e507aec05 Bug 1453301 - Stop supporting about:blank in fetch to match the spec. r=baku
MozReview-Commit-ID: DMku5SAunfo

--HG--
extra : rebase_source : d9cf72be144b41cd5d8c6dbe4042a6e835c12ef3
2018-08-03 21:52:36 -04:00
Valentin Gosu
7937c7c4cc Bug 1476928 - Remove nsIURI.CloneIgnoringRef and nsIURI.CloneWithNewRef r=JuniorHsu
The patch introduces NS_GetURIWithNewRef and NS_GetURIWithNewRef which perform the same function.

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

--HG--
extra : moz-landing-system : lando
2018-07-23 11:28:47 +00:00
Andi-Bogdan Postelnicu
88cc63910d Bug 1453795 - DOM - Initialize member fields in classes/ structures. r=peterv
--HG--
extra : rebase_source : 249fc26e50bded4e94f5effa4308af0f1e54b908
2018-06-16 17:21:46 +03:00
Andrea Marchesini
7ba8b77e07 Bug 1466023 - Separate FontTableURI and BlobURL, r=qdot
This patch splits FontTableURI and BlobURL in 2 classes:
FontTableURIProtocolHandler and BlobURLProtocolHandler
both under mozilla::dom.

It also removes a memory reporter because that report is already covered by the
BlobURL one.

--HG--
rename : dom/file/nsHostObjectProtocolHandler.cpp => dom/file/BlobURLProtocolHandler.cpp
rename : dom/file/nsHostObjectProtocolHandler.h => dom/file/BlobURLProtocolHandler.h
2018-06-02 15:51:42 +02:00
Emilio Cobos Álvarez
fffb25b74f Bug 1465585: Switch from mozilla::Move to std::move. r=froydnj
This was done automatically replacing:

  s/mozilla::Move/std::move/
  s/ Move(/ std::move(/
  s/(Move(/(std::move(/

Removing the 'using mozilla::Move;' lines.

And then with a few manual fixups, see the bug for the split series..

MozReview-Commit-ID: Jxze3adipUh
2018-06-01 10:45:27 +02:00
Sebastian Hengst
0819f35e51 Backed out 4 changesets (bug 525063) on request from Andi. a=backout
Backed out changeset 516c4fb1e4b8 (bug 525063)
Backed out changeset 6ff8aaef2866 (bug 525063)
Backed out changeset bf13e4103150 (bug 525063)
Backed out changeset d7d2f08e051c (bug 525063)
2018-04-13 16:01:28 +03:00
Tristan Bourvon
a3a77c0312 Bug 525063 - Initialize uninitialized class attributes in m-c. r=ehsan 2018-04-10 21:11:02 +02:00
Andrea Marchesini
86d581422b Bug 1440941 - FetchDriver should check if the operation has been already aborted when OnStartRequest is called, r=bkelly 2018-02-26 22:32:15 +01:00
Eric Rahm
3efc420b11 Bug 1437693 - Stop warning about unknown content lengths. r=bkelly
--HG--
extra : rebase_source : 943658882837ad790542231634d2a24c21906094
2018-02-12 14:54:14 -08:00
Eric Rahm
9f798eecf1 Bug 1437188 - Part 1: Remove verbose fetch related warnings. r=bkelly
This removes the most verbose fetch related warnings. Cumulatively these
account for about 11,000 warnings during testing.

--HG--
extra : rebase_source : ee930dec1e18b9a7f34d5c66944dc015be10be69
2018-02-09 14:04:03 -08:00
Andrea Marchesini
8cdf705535 Bug 1435174 - Remove the renaming 'using namespace workers', r=bkelly 2018-02-05 19:55:07 +01:00
Andrea Marchesini
7e52540256 Bug 1432963 - Fixing workers headers - part 16 - JSSettings in a workerinternals namespace, r=smaug 2018-01-31 08:24:59 +01:00
Andrea Marchesini
3513d1c407 Bug 1413112 - Renaming Workers.h to WorkerCommon.h, r=bkelly
--HG--
rename : dom/workers/Workers.h => dom/workers/WorkerCommon.h
2018-01-30 10:10:04 +01:00
Andrea Marchesini
c6da271117 Bug 1425458 - Resource timing entries Workers - part 0 - NS_NewChannel, r=smaug
* * *
Bug 1425458 - Resource timing entries Workers - part 10 - Correct parameters in NS_NewChannel in nsDataObj.cpp, r=me
2018-01-24 17:17:31 +01:00
Brindusan Cristian
368c3d5b6b Backed out 12 changesets (bug 1425458) for mochitest failures on WorkerPrivate.cpp on a CLOSED TREE
Backed out changeset 11997de13778 (bug 1425458)
Backed out changeset 100b9d4f36bc (bug 1425458)
Backed out changeset a29e9dbb8c42 (bug 1425458)
Backed out changeset b96d58fd945c (bug 1425458)
Backed out changeset f140da44ba68 (bug 1425458)
Backed out changeset af56400233d9 (bug 1425458)
Backed out changeset 7034af4332e4 (bug 1425458)
Backed out changeset f70500179140 (bug 1425458)
Backed out changeset 793bbfc23257 (bug 1425458)
Backed out changeset 2efb375a8ffc (bug 1425458)
Backed out changeset 07e781e37451 (bug 1425458)
Backed out changeset e875f3702a5f (bug 1425458)
2018-01-24 20:47:48 +02:00
Andrea Marchesini
6480b95ba3 Bug 1425458 - Resource timing entries Workers - part 0 - NS_NewChannel, r=smaug 2018-01-24 17:17:31 +01:00
Andrea Marchesini
f3ba47cb22 Bug 1432713 - PerformanceResouceTiming entries should have initiatorType set to 'fetch' if related to Fetch method requests, r=smaug 2018-01-24 12:45:59 +01:00
Ben Kelly
ede8f70716 Bug 1231211 P14 Make fetch() pass worker ClientInfo and ServiceWorkerDescriptor to NS_NewChannel(). r=asuth 2018-01-23 10:38:54 -05:00
Luke Crouch
30b0ae88f8 Bug 587523: remove branching logic; comment fixups r=valentin
MozReview-Commit-ID: J8LGTUMehZA

--HG--
extra : rebase_source : bd14c0a652c06e6cdb73c6c52034a4fd2f3abbef
2018-01-18 09:57:14 -06:00
Luke Crouch
c95e646b6b Bug 587523: update Fetch API referrer to check for private browsing pref r=valentin
MozReview-Commit-ID: 2DFYcWuXfnn

--HG--
extra : rebase_source : 05bf93b54e25ea7962379a6b6b51c46d73d660b6
2018-01-16 15:26:26 -06:00
Andrew Sutherland
f3a816271e Bug 1416879 - Part 4: FetchDriver needs to propagate write failures. r=baku
In the scenario where a ServiceWorker returns a pass-through fetch via
`evt.respondWith(fetch("underlying"))`, in order for the "underlying"
HTTP channel to be canceled when the outer HTTP channel is canceled,
FetchDriver's OnDataAvailable method needs to return an error when
the output pipe experiences an error.

Unfortunately, the contract for ReadSegments is effectively that it
returns NS_OK regardless of what the rv of the write handler returned,
so relying on the returned rv is insufficient.  And because various
Write*() methods will all fast-path to returning NS_OK if a count of 0
is passed, it's necessary to infer a closed/broken pipe by noticing
that we tried to write more than 0 bytes of data but 0 bytes were
written.  (This is safe because the pipe we write into was created
by FetchDriver::OnStartRequest which explicitly creates an infinite
pipe, so it's not possible for the write to fail due to lack of space
in the pipe.)

--HG--
extra : rebase_source : 0a1f9f7a4c244934ff255a07e78608c8ea6fef0e
extra : source : 8e4fd74e7f5e69df7363bdb560f79dde347ce082
2018-01-04 18:04:55 -05:00
Brindusan Cristian
f42618c99d Backed out 6 changesets (bug 1416879) for bc permafailures on windows on browser_multie10s_update.js r=backout a=backout
Backed out changeset 840a6e04bcea (bug 1416879)
Backed out changeset 994dc643a2ab (bug 1416879)
Backed out changeset 8e4fd74e7f5e (bug 1416879)
Backed out changeset 5453b8a58f0c (bug 1416879)
Backed out changeset d156f6b687e1 (bug 1416879)
Backed out changeset 714d3942fb10 (bug 1416879)
2018-01-07 11:55:44 +02:00
Andrew Sutherland
8da7ba26dd Bug 1416879 - Part 4: FetchDriver needs to propagate write failures. r=baku
In the scenario where a ServiceWorker returns a pass-through fetch via
`evt.respondWith(fetch("underlying"))`, in order for the "underlying"
HTTP channel to be canceled when the outer HTTP channel is canceled,
FetchDriver's OnDataAvailable method needs to return an error when
the output pipe experiences an error.

Unfortunately, the contract for ReadSegments is effectively that it
returns NS_OK regardless of what the rv of the write handler returned,
so relying on the returned rv is insufficient.  And because various
Write*() methods will all fast-path to returning NS_OK if a count of 0
is passed, it's necessary to infer a closed/broken pipe by noticing
that we tried to write more than 0 bytes of data but 0 bytes were
written.  (This is safe because the pipe we write into was created
by FetchDriver::OnStartRequest which explicitly creates an infinite
pipe, so it's not possible for the write to fail due to lack of space
in the pipe.)

--HG--
extra : rebase_source : 788dab679298841fc03bb054458b6f8cc4a0a8d9
2018-01-04 18:04:55 -05:00
Eden Chuang
4dddce09c7 Bug 1350359 - Part 6: Make sure releasing nsICacheInfoChannel of InternalResponse on the main thread. r=bkelly
Using nsMainThreadPtrHandle to hold the nsICacheInfoChannel in the
    InternalResponse.

--HG--
extra : histedit_source : 125f31c63fce1cbd9995d29688e7795efad3a417
2017-12-06 01:13:54 +08:00
Eden Chuang
7f3b4d6b1a Bug 1350359 - Part 4: Fix a crash caused by off-main-thread destruction of a HttpChannelChild. r=bkelly
Setting the InternalResponse's mCacheInfoChannel while needed, to avoid
    keeping unnecessary nsICacheInfoChannel alive.

--HG--
extra : histedit_source : 39f9339b69db52b0278495d5247bc99ffd1d8f79
2017-12-04 14:39:26 +08:00
Eden Chuang
4a65d93564 Bug 1350359 - Part 2: Fetch and save alterntative data to InternalResponse. r=bkelly
Create a new class AlternativeDataStreamListener for alternative data and
    main data overlap loading.
    AlternativeDataStreamListener coorperates with FetchDriver to handle
    following situations
      1. There is no preferred alternative data type in InternalRequest
         Directly using FetchDriver to listen on the opened channel

      2. If preferred alternative data type exists in InternalRequest, but no
         saved data in cache.
         AlternativeDataStreamListener is constructed to listen on the channel,
         but its status would be set as FALLBACK and redirect callbacks to
         FetchDriver.

      3. If preferred alternative data type exists in InternalRequest, and the
         data also exists in the cache.
         AlternativeDataStreamListener is constructed to listen on the channel
         for loading the alternative data. And also open a channel listened by
         FetchDriver for loading the main data when AlternativeDataStreamListener::
         OnStartRequest is called.
         If the cacheEntryId is different between main data channel and
         alternative data channel, we will cancel the alternative data loading.
2017-12-04 14:39:15 +08:00
Edouard Oger
ee0f18811d Bug 1416842 - Allow fetch to reject with nsresult in chrome code. r=bkelly
MozReview-Commit-ID: FD2NUJZtAhT

--HG--
extra : rebase_source : cff033ea3d7e9581112392e7725290819fbec18b
2017-11-15 14:53:42 -05:00