Commit Graph

527 Commits

Author SHA1 Message Date
Andrea Marchesini
7970f659de Bug 1419771 - Introduce DOMPrefs, a thread-safe access to preferences for DOM - part 18 - FetchObserver API enabled, r=asuth 2018-01-08 14:05:05 +01:00
Andrea Marchesini
aacb9ccdfb Bug 1419771 - Introduce DOMPrefs, a thread-safe access to preferences for DOM - part 14 - Request Context enabled, r=asuth 2018-01-08 14:05:05 +01: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
31246a1058 Bug 1416879 - Part 5: FetchStreamReader needs to cancel its reader when it encounters write errors. r=baku, f=bkelly
Currently, FetchStreamReader never signals to the JS stream code that
the reader has been closed.  This means that when a ServiceWorker
passes a ReadableStream to respondWith and the HTTP Channel gets
canceled, the JS code will keep generating the stream without ever
realizing the data's not going anywhere.  It's necessary to cancel
the reader.  Or do something like that, this seems to work!

--HG--
extra : rebase_source : 559af90ba766ebd4deb5d99b6696cd2207215f9f
2018-01-04 18:09:32 -05: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
Andrea Marchesini
2e497a02f6 Bug 1418074 - Introducing a WorkerHolder to release AbortSignal on the correct thread, r=bkelly 2017-12-22 10:06:47 +01:00
Andrea Marchesini
d3e4e6067c Bug 1418074 - Get rid of friend classes in WorkerFetchResolver, r=bkelly 2017-12-22 10:05:48 +01: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
Eden Chuang
7211e8c25c Bug 1350359 - Part 1: Set alternative data type from InterceptedChannel to InternalRequest. r=bkelly 2017-12-04 14:39:10 +08:00
Cosmin Sabou
5c4663243d Backed out 23 changesets (bug 1419771) for frequently failing service workers related devtools tests, e.g. devtools/client/aboutdebugging/test/browser_service_workers_push.js. r=backout on a CLOSED TREE
Backed out changeset 2242edc902a5 (bug 1419771)
Backed out changeset 9cc3c29a9e36 (bug 1419771)
Backed out changeset c39ee002c825 (bug 1419771)
Backed out changeset caf7428013f2 (bug 1419771)
Backed out changeset c03970363433 (bug 1419771)
Backed out changeset 7f9de012861e (bug 1419771)
Backed out changeset ed146ac42a7f (bug 1419771)
Backed out changeset a8154698f782 (bug 1419771)
Backed out changeset 8a54c1c8d45d (bug 1419771)
Backed out changeset e32cd55b4c96 (bug 1419771)
Backed out changeset b7f342f436ef (bug 1419771)
Backed out changeset 60464b3e468f (bug 1419771)
Backed out changeset 108806f14ad8 (bug 1419771)
Backed out changeset 65998b0740f3 (bug 1419771)
Backed out changeset 0d23880842d8 (bug 1419771)
Backed out changeset 862aeaa2fefd (bug 1419771)
Backed out changeset cbc192478bf5 (bug 1419771)
Backed out changeset c58ef2a91bad (bug 1419771)
Backed out changeset 2b0a4bfd654f (bug 1419771)
Backed out changeset f182eba574f9 (bug 1419771)
Backed out changeset d9999a624097 (bug 1419771)
Backed out changeset 4050a1b8db2b (bug 1419771)
Backed out changeset a1a68e6500d9 (bug 1419771)
2017-11-30 22:35:32 +02:00
Andrea Marchesini
ff3102232c Bug 1419771 - Introduce DOMPreferences, a thread-safe access to preferences for DOM - part 19 - FetchObserver API enabled, r=asuth 2017-11-30 18:16:46 +01:00
Andrea Marchesini
4f8c375ea7 Bug 1419771 - Introduce DOMPreferences, a thread-safe access to preferences for DOM - part 15 - Request Context enabled, r=asuth 2017-11-30 18:16:46 +01:00
Andrea Marchesini
1fd1731f81 Bug 1419382 - Moving ownership of nsIInputStream when using netUtil functions - part 3 - NS_NewInputStreamPump, r=smaug 2017-11-22 11:18:57 +01:00
Edouard Oger
6341dc253c Bug 1419146 - Respect mozErrors in Request. r=bkelly
MozReview-Commit-ID: Lbx395q7BYF

--HG--
extra : rebase_source : 9928a998378b4f84914f0b45ebb2266f34b04230
2017-11-20 17:07:26 -05: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
Andrea Marchesini
97baa05333 Bug 1398229 - Save-link-as feature should use the loading principal - part 3 - implementation of nsIContentPolicy.TYPE_SAVE_AS_DOWNLOAD, r=ckerschb, r=tanvi 2017-11-16 12:27:01 +01:00
Sebastian Hengst
6c1d6be6fb Backed out 3 changesets (bug 1398229) for failing own browser-chrome browser/components/contextualidentity/test/browser/browser_saveLink.js. r=backout on a CLOSED TREE
Backed out changeset 5b3b0a38b2d1 (bug 1398229)
Backed out changeset a726fc7506ca (bug 1398229)
Backed out changeset 53dae7764e58 (bug 1398229)
2017-11-15 20:49:09 +02:00
Andrea Marchesini
11eefa61bb Bug 1398229 - Save-link-as feature should use the loading principal - part 3 - implementation of nsIContentPolicy.TYPE_SAVE_AS_DOWNLOAD, r=ckerschb 2017-11-15 18:16:29 +01:00
Andrea Marchesini
73712f7d05 Bug 1405290 - Improve logging of workers when shutting down - part 3 - WorkerHolder with names, r=asuth 2017-11-15 07:58:38 +01:00
Andrew McCreight
1d0acbdb9b Bug 1412125, part 1 - Manually add mode lines and MPL to files that were missing them entirely. r=qdot
These were detected by the script used to generate part 2.

MozReview-Commit-ID: VMcT154f6f

--HG--
extra : rebase_source : 2f5fc8a314302fcacac840a8dbe0ff874d518e51
2017-10-26 14:54:59 -07:00
Ben Kelly
9d8fb37a12 Bug 1380255 P2 Don't fire FetchDriverObserver::OnDataAvailable() for every FetchDriver ODA callback. r=baku 2017-10-12 19:23:16 -07:00
Catalin Badea
6a9fd06ae6 Bug 1380255 - FetchDriver should have threadsafe refcounting. r=baku 2017-09-26 11:53:00 +01:00
Jonathan Watt
24b417787f Bug 1406820 part 1. Initialize InternalRequest::mBodyLength in the fetch code. r=qdot 2017-10-11 00:46:17 +01:00
Luke Wagner
cf897d6fcb Bug 1347644 - Baldr: implement ConsumeStreamCallback in browser (r=bkelly)
MozReview-Commit-ID: DXv2MegefDw

--HG--
extra : rebase_source : aca4d6e40ae9af03e05520ec8bdef92889e44acc
2017-10-10 14:41:24 -05:00
Ben Kelly
47571637f3 Bug 1391693 P4 Don't count internal redirects towards Response.redirected r=tt 2017-10-09 10:03:40 -07:00
Sebastian Hengst
15b8e9a53b Backed out changeset 097c44e15165 (bug 1371699) 2017-10-05 13:10:55 +02:00
Andrea Marchesini
1867437172 Bug 1371699 - Use of NonBlockingAsyncInputStream in our code base, r=froydnj 2017-10-03 07:20:18 +02:00
Sebastian Hengst
e8e914baa7 Backed out changeset c033bdb24e14 (bug 1371699) 2017-10-03 16:55:02 +02:00
Andrea Marchesini
ff3b280260 Bug 1371699 - Use of NonBlockingAsyncInputStream in our code base, r=froydnj 2017-10-03 07:20:18 +02:00
Andrea Marchesini
baa04d619a Bug 1120178 - Migrate DOMError to DOMExtension in FileReader, IndexedDB, DOMRequest and so on, r=smaug 2017-08-06 20:47:00 +03:00
Sebastian Hengst
fa921ed2a3 Backed out changeset 22a322b57f50 (bug 1380255) for asserting and failing mochitest-plain toolkit/components/extensions/test/mochitest/test_ext_webrequest_responseBody.html. r=backout 2017-09-26 15:45:24 +02:00
Catalin Badea
32e27f63b8 Bug 1380255 - FetchDriver should have threadsafe refcounting. r=baku 2017-09-26 12:52:53 +01:00
Andrea Marchesini
53d31f2d9c Bug 1402888 - Remove nsIInputStreamPump::Init() offset and limit params, r=smaug 2017-09-26 07:21:44 +02:00
Andrea Marchesini
86c5c52e0e Bug 1402888 - Remove nsIStreamTransportService::createInputStream startOffset and readLimit params, r=smaug 2017-09-26 07:21:27 +02:00
Chris Peterson
a6a56ed916 Bug 870698 - Part 6: Replace Append(NS_LITERAL_CSTRING("")) with AppendLiteral(""). r=erahm
The NS_LITERAL_CSTRING macro creates a temporary nsLiteralCString to encapsulate the string literal and its length, but AssignLiteral() can determine the string literal's length at compile-time without nsLiteralCString.

MozReview-Commit-ID: F750v6NN81s

--HG--
extra : rebase_source : 714dd78df0f4c33e23e5b117615bd8fd561674c5
extra : source : 742bda9e6b1ddaf34d09894204ad18ce798b79b7
2017-09-07 18:25:25 -07:00
Andrea Marchesini
4753d050bd Bug 1396848 - Iterating a Header object returns sorted and combined values, r=qdot 2017-09-17 11:18:20 +02:00
Andrea Marchesini
157334f4b0 Bug 1397627 - Fetch API and other components should pass the length of the stream to necko when known, r=smaug 2017-09-08 16:06:26 +02:00
Shawn Huang
00788aac72 Bug 1396300 - Use fallible allocation in GetAsStream. r=bkelly 2017-09-08 11:59:46 +08:00
Tom Tung
a1e22fa9e7 Bug 1290481 - P5: Implement a function to generate padding size. r=bkelly
MozReview-Commit-ID: 6poDeyErBjc

--HG--
extra : rebase_source : 982139c536c17a6699d700df7c8b3071939bb3c0
2017-07-10 17:03:24 +08:00
Tom Tung
9321dc629d Bug 1290481 - P1: Make InternalResponse and CacheResponse be able to keep padding size. r=bkelly
MozReview-Commit-ID: LIxkSdfPZtf

--HG--
extra : rebase_source : ff52bdc1cc813ebc4d5ec679b4bac3dfb52550ac
2017-07-10 17:11:29 +08:00
Andrea Marchesini
ec603f10be Bug 1381748 - Cleanup FetchConsumer workflow - part 3 - shutdown workflow, r=catalinb 2017-09-04 17:06:47 +02:00
Andrea Marchesini
08253b4c69 Bug 1381748 - Cleanup FetchConsumer workflow - part 2 - cleanup RegisterWorkerHolder, r=catalinb 2017-09-04 17:06:31 +02:00
Andrea Marchesini
0af2f0aa2c Bug 1381748 - Cleanup FetchConsumer workflow - part 1 - no mBody, r=catalinb 2017-09-04 17:06:18 +02:00
Sebastian Hengst
e2f54c0cd7 merge mozilla-central to autoland. r=merge a=merge 2017-09-01 10:43:32 +02:00
Honza Bambas
8d492fe637 Bug 1395525 - Make all changes landed as part of tracker request tailing preferrable. r=dragana 2017-08-31 06:07:00 -04:00
Tom Tung
f3b0f175ac Bug 1393439 - P2: Correct the variable naming. r=bkelly
MozReview-Commit-ID: 1DblOV82nEd

--HG--
extra : rebase_source : e03fc7b091d7aa4a6076660416f2c9514ad8894b
2017-08-29 16:00:35 +08:00
Tom Tung
85b52e428b Bug 1393439 - P1: Don't return TypeError for no-cors mode and don't check SRI for the hidden opaque body. r=bkelly
MozReview-Commit-ID: 1IspF2IlqqP

--HG--
extra : rebase_source : acee9a04c1be416fa8c779308062d3aebdba8b6a
2017-08-25 16:36:59 +08:00
Andrea Marchesini
76ea37870c Bug 1390717 - FetchStream should not have an extra JS::Heap<ReadableStream>, r=jonco 2017-08-31 16:29:02 +02:00