Commit Graph

973 Commits

Author SHA1 Message Date
Matthew Gaudet
a215c65d60 Bug 1751917 - Indicate JS Exception handling to ErrorResult in FetchStreamReader r=saschanaz
Differential Revision: https://phabricator.services.mozilla.com/D136913
2022-01-25 21:29:18 +00:00
Eden Chuang
2266b31d41 Bug 1744025 - Replace include "mozilla/dom/WorkerPrivate.h" with include "mozilla/dom/WorkerScope.h" where WorkerPrivate->GlobalScope() is called. r=dom-worker-reviewers,smaug,jstutte
#include "mozilla/dom/WorkerScope.h" is removed from WorkerPrivate.h, where calling WorkerPrivate::GlobalScope() without include "WorkerScope.h" makes WorkerScope as an incomplete type.


Depends on 132800

Depends on D132800

Differential Revision: https://phabricator.services.mozilla.com/D133483
2022-01-25 08:53:03 +00:00
Eden Chuang
128ff19446 Bug 1744025: Remove only assertion-relevant mWorkerPrivate from FetchBody. r=dom-worker-reviewers,edenchuang
Depends on D132711

Differential Revision: https://phabricator.services.mozilla.com/D132795
2022-01-25 08:53:01 +00:00
Kagami Sascha Rosylight
67e19158c2 Bug 1751453 - Part 2: Remove WorkerSignalFollower r=smaug
I originally intended to remove the cycle collection only, but then I found that there's zero use of this class.

Differential Revision: https://phabricator.services.mozilla.com/D136659
2022-01-24 13:18:34 +00:00
Kagami Sascha Rosylight
19504fbdf1 Bug 1751453 - Part 1: Remove AbortFollower::Unlink() r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D136658
2022-01-24 13:18:33 +00:00
Kagami Sascha Rosylight
e3cec0f91e Bug 1660555 - Let AbortSignal grab strong references to its followers r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D136447
2022-01-21 14:40:39 +00:00
Kagami Sascha Rosylight
9d024af1cc Bug 1660555 - Make AbortFollower::mFollowingSignal a WeakPtr r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D136446
2022-01-21 14:40:38 +00:00
Kagami Sascha Rosylight
cd40833835 Bug 1750543 - Don't abort by signal if consuming request body by DOM methods r=smaug
There are two cases when reading request body by DOM methods:

1. It's being read before fetch()
2. or after fetch()

The first case shouldn't be affected by abort signal per the spec, since the abort step is added only within fetch().

https://fetch.spec.whatwg.org/#ref-for-abortsignal-add

The second case should still fail but with `TypeError: Body has already been consumed`, not AbortError.

Differential Revision: https://phabricator.services.mozilla.com/D136262
2022-01-21 11:18:17 +00:00
Matthew Gaudet
bc10b96605 Bug 1748888 - Add ErrorResult parameter to PromiseNativeHandler callbacks r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D136423
2022-01-20 19:11:39 +00:00
Jan Varga
c7d00f4557 Bug 1750931 - Fix non-unified-build bustage in dom/events, dom/fetch and dom/streams; r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D136315
2022-01-19 11:09:55 +00:00
Matthew Gaudet
ca57a3eb42 Bug 1750606 - Use script boundaries to make DOM streams buildable r=saschanaz
This gets us back to the state we were in with JS Streams. There's a fair
amount of work to get this annotation correct, and some tricky cases to
handle.

Differential Revision: https://phabricator.services.mozilla.com/D136178
2022-01-18 14:39:45 +00:00
Matthew Gaudet
e6f0e756a1 Bug 1734873 - Fetch/Response/Blob ReadableStream integration r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D131550
2022-01-14 21:09:20 +00:00
Jens Stutte
a3884ad516 Bug 1741182: Harmonize WorkerRunnable derived classes' overrides of Cancel. r=dom-worker-reviewers,smaug
Differential Revision: https://phabricator.services.mozilla.com/D135679
2022-01-12 14:43:09 +00:00
Olli Pettay
d4a7fd0c32 Bug 1749188, clear JS member variable during unlink, r=mccr8
Differential Revision: https://phabricator.services.mozilla.com/D135498
2022-01-10 22:35:15 +00:00
Eden Chuang
02e83cbd20 Bug 1725567 - P5 Support canceling fetching which launched by FetchService. r=dom-worker-reviewers,jesup
Cancel the navigation preload fetching while the FetchEvent has already received Recvdelete or RecvRespondWith

Depends on D129809

Differential Revision: https://phabricator.services.mozilla.com/D130183
2022-01-04 14:42:35 +00:00
Eden Chuang
03fdb1e266 Bug 1725567 - P4 Integrating FetchDriver into FetchService::FetchInstance. r=dom-worker-reviewers,jesup
This patch integrates the FetchDriver into FetchInstance implementation.

The needed information by constructing a FetchDriver would be prepared in FetchInstance::Initialize().

When FetchInstance::Fetch() is called, a FetchDriver would be created according to the information get from Initialize(). FetchDriver will handle the channel creation and its necko related issues.

At the same time, FetchInstance is registered as the FetchDriver's observer, such that the FetchInstance can use the response to resolve the corresponding promise to notify the consummers.

Depends on D129808

Differential Revision: https://phabricator.services.mozilla.com/D129809
2022-01-04 14:42:35 +00:00
Eden Chuang
c9e81a52fe Bug 1725567 - P3 Implement FetchDriverOberser internface for FetchInstance. r=dom-worker-reviewers,jesup
This patch makes FetchInstance inherits FetchDriverObserver, such that FatchInstance can resolve the PreloadResponse promise once FetchDriver finishes fetching.

This patch only implements the necessary interface for navigation preload.
OnResponseEnd()
OnResponseAvailableInternal()
Other methods such as NeededOnDataAvailable(), OnDataAvailable is not implemented.
But these methods should be implemented with PFatch implementation.

Depends on D128223

Differential Revision: https://phabricator.services.mozilla.com/D129808
2022-01-04 14:42:34 +00:00
Eden Chuang
7245366e6f Bug 1725567 - P2 FetchService interface declaration. r=dom-worker-reviewers,jesup
This patch defines the interface of FetchService for its consumers.

RefPtr<FetchServiceResponsePromise>&& FetchService::Fetch(SafeRefPtr<InternalRequest> aRequest);

FetchService is a singleton object in the parent process main thread, which is used for managing all the requested fetching created by FetchService.
It would also support more control capability, such as abort or cancel, and also observers for shutdown or other cases. These would be implemented in the following patches.

FetchInstance is an internal representation for each fetching.

Depends on D128465

Differential Revision: https://phabricator.services.mozilla.com/D128223
2022-01-04 14:42:34 +00:00
Jens Stutte
06fe91a811 Bug 1650940: Only assert FetchStreamReader members in OnOutputStreamReady if we are not closed. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D134297
2021-12-20 18:10:09 +00:00
Norisz Fay
5edb88e27a Backed out 9 changesets (bug 1744025) for causing wpt failures on CheckedUnsafePtr.h CLOSED TREE
Backed out changeset 89dca4fc5940 (bug 1744025)
Backed out changeset 7aa395dcdbe4 (bug 1744025)
Backed out changeset 1580a4ea1a85 (bug 1744025)
Backed out changeset af171636a87f (bug 1744025)
Backed out changeset a5edfa1c9cd6 (bug 1744025)
Backed out changeset 8abd6ba69815 (bug 1744025)
Backed out changeset cfb822df5b3f (bug 1744025)
Backed out changeset 5598943a94fd (bug 1744025)
Backed out changeset 43186fbbf8b4 (bug 1744025)
2021-12-15 18:46:01 +02:00
Eden Chuang
4146950108 Bug 1744025 - Replace include "mozilla/dom/WorkerPrivate.h" with include "mozilla/dom/WorkerScope.h" where WorkerPrivate->GlobalScope() is called. r=dom-worker-reviewers,smaug,jstutte
#include "mozilla/dom/WorkerScope.h" is removed from WorkerPrivate.h, where calling WorkerPrivate::GlobalScope() without include "WorkerScope.h" makes WorkerScope as an incomplete type.


Depends on 132800

Depends on D132800

Differential Revision: https://phabricator.services.mozilla.com/D133483
2021-12-15 13:48:19 +00:00
Jens Stutte
2afbc37d6b Bug 1744025: Remove only assertion-relevant mWorkerPrivate from FetchBody. r=dom-worker-reviewers,edenchuang
Depends on D132711

Differential Revision: https://phabricator.services.mozilla.com/D132795
2021-12-15 13:48:18 +00:00
Kagami Sascha Rosylight
712c0d58c7 Bug 1737771 - Implement AbortSignal.reason r=mgaudet,smaug
Differential Revision: https://phabricator.services.mozilla.com/D132281
2021-12-13 21:08:55 +00:00
Cosmin Sabou
fdf40d5a31 Backed out changeset 1778ca2ab291 (bug 1744425) for bc failures on browser_xpcom_graph_wait.js. CLOSED TREE 2021-12-08 07:20:54 +02:00
Chris Peterson
aae95e46eb Bug 1744425 - Replace nsContentUtils::GenerateUUID() to nsID::GenerateUUID(). r=nika
Bug 1723674 added a new nsID::GenerateUUID() static factory function to generate UUIDs without the overhead of querying and instantiating an nsIUUIDGenerator object. nsContentUtils::GenerateUUID() is a utility function that amortizes that overhead by holding an nsIUUIDGenerator singleton. That's no longer necessary because code that calls nsContentUtils::GenerateUUID() can now just call nsID::GenerateUUID(). No nsIUUDGenerator is needed.

Differential Revision: https://phabricator.services.mozilla.com/D132866
2021-12-08 03:19:11 +00:00
Sandor Molnar
68afd87d02 Backed out 8 changesets (bug 1744025) for causing bp-hybrid bustages in dom/clients/api/Clients.cpp. CLOSED TREE
Backed out changeset b6452430763d (bug 1744025)
Backed out changeset 46e9f06636da (bug 1744025)
Backed out changeset 913cdee4824f (bug 1744025)
Backed out changeset e1bc4e2066c7 (bug 1744025)
Backed out changeset e6b99af4b7ca (bug 1744025)
Backed out changeset e9b749f80ec2 (bug 1744025)
Backed out changeset 26d3176a00ef (bug 1744025)
Backed out changeset 2c8941fdcee5 (bug 1744025)
2021-12-08 01:30:06 +02:00
Jens Stutte
b16f0a884c Bug 1744025: Remove only assertion-relevant mWorkerPrivate from FetchBody. r=dom-worker-reviewers,edenchuang
Differential Revision: https://phabricator.services.mozilla.com/D132795
2021-12-07 16:47:17 +00:00
Yury Delendik
8c65b7aee8 Bug 1738987 - Ignore altdata stream errors on shutdown. r=valentin
Differential Revision: https://phabricator.services.mozilla.com/D131960
2021-11-30 22:01:56 +00:00
Yury Delendik
93736fc03a Bug 1737405 - Remove superfluous wasm cache stream check. r=valentin
The `self->mZStream.avail_out > 0` check is not correct assert.
In some rare cases the incoming data may not produce any output.

Rely on zlib's inflate() to perform needed validation.

Differential Revision: https://phabricator.services.mozilla.com/D132516
2021-11-30 22:00:28 +00:00
Yury Delendik
07a8dcb5b3 Bug 1737405 - Change MOZ_DIAGNOSTIC_ASSERTs in wasm cache code. r=valentin
Separate asserts logic to provide more details for crashes.

Differential Revision: https://phabricator.services.mozilla.com/D131865
2021-11-23 14:55:16 +00:00
Yaron Tausky
c24bfb26ba Bug 1577346 - Convert between stream types for preload response r=dom-worker-reviewers,edenchuang
A previous patch added code paths that propagate the preload response
from the parent process's main thread to the service worker in the
content process, but left out the conversions between different stream
types. This commit adds these conversions.

Based on D122822.

Differential Revision: https://phabricator.services.mozilla.com/D131380
2021-11-22 14:09:24 +00:00
Yaron Tausky
83bb5d45cd Bug 1741493 - Split IPCInternalResponse r=nika
This commit replaces IPCInternalResponse with three different structs:
ParentToParentInternalResponse, ParentToChildInternalResponse, and
ChildToParentInternalResponse. Doing this lets us convert runtime
checks into compile-time type checks and simplifies relevant code.

Differential Revision: https://phabricator.services.mozilla.com/D131275
2021-11-19 16:45:19 +00:00
Eden Chuang
44f5b17747 Bug 1577346 - P3 Make InternalResponse be SafeRefcounted. r=dom-worker-reviewers,ytausky
Depends on D126243

Differential Revision: https://phabricator.services.mozilla.com/D126244
2021-11-08 13:29:32 +00:00
Yury Delendik
a143705045 Bug 1737837 - Fix truncated storeOptimizedEncoding stream. r=jandem
Differential Revision: https://phabricator.services.mozilla.com/D129880
2021-11-01 13:38:40 +00:00
Yury Delendik
b92dc38227 Bug 1545131 - compress wasm alt data entries (r=jandem)
Differential Revision: https://phabricator.services.mozilla.com/D27992
2021-10-21 22:08:14 +00:00
Niklas Goegge
1244799959 Bug 1732052: Remove pref privacy.file_unique_origin r=ckerschb,necko-reviewers,dragana
Differential Revision: https://phabricator.services.mozilla.com/D126898
2021-10-19 12:57:34 +00:00
msub2
d7037d2ab2 Bug 1726734 - Replace deprecated octal sequences to satisfy ESLint no-octal-rule. r=Standard8
Differential Revision: https://phabricator.services.mozilla.com/D128684
2021-10-18 14:37:04 +00:00
Yury Delendik
1726518b39 Bug 1487113 - prevent ~JSStreamConsumer from GCing. r=peterv
Differential Revision: https://phabricator.services.mozilla.com/D127333
2021-10-15 21:13:45 +00:00
Yury Delendik
469b4875d8 Bug 1487113 - Add pref javascript.options.wasm_caching. r=necko-reviewers,valentin
Differential Revision: https://phabricator.services.mozilla.com/D27101
2021-10-15 21:13:44 +00:00
Yury Delendik
c80de90e54 Bug 1487113 - Use alt-data to cache stream-compiled WebAssembly modules. r=necko-reviewers,valentin,dragana
Depends on D117360

Differential Revision: https://phabricator.services.mozilla.com/D26731
2021-10-15 21:13:44 +00:00
Yury Delendik
04ca8c2532 Bug 1487113 - nsICacheInfoChannel.alternativeDataInputStream as attribute. r=necko-reviewers,valentin
Differential Revision: https://phabricator.services.mozilla.com/D117360
2021-10-15 21:13:43 +00:00
Matthew Gaudet
3bcfc27cef Bug 1730589 - Initial Implementation of ReadableStreams using WebIDL and DOM technologies r=smaug
This patch begins re-implements ReadableStreams using WebIDL and DOM technology (vs the existing JS streams implementation).   Some more background is [here](https://docs.google.com/document/d/1MWRkF32KV60ngOY-Ip4PnKbCMvl6VK_Y9QLED8MJJxg/edit#)

This is guarded under a configure flag `--enable-dom-streams`

1. ByteStreams and ReadableStream.tee will come in future patches.
2. I intentionally crash in other parts of the DOM that require streams (Fetch, Response, Blob), until the integration work is done in future patches.

   My current plan for that integration doesn't involve re-creating the alternative 'external streams' API from SpiderMonkey's implementation, but I have yet to do enough development to verify that will work.

Differential Revision: https://phabricator.services.mozilla.com/D122643
2021-10-06 18:43:01 +00:00
Andreas Pehrson
8104de54c0 Bug 1729964 - Fix linker error. r=baku
Differential Revision: https://phabricator.services.mozilla.com/D126918
2021-10-06 14:33:40 +00:00
Mike Hommey
ad42c13a73 Bug 1733034 - Fix unreachable-code-return warnings in dom. r=smaug
dom/console/Console.cpp:2899:10: error: 'return' will never be executed [-Werror,-Wunreachable-code-return]
  return 0;
         ^
dom/console/Console.cpp:2955:10: error: 'return' will never be executed [-Werror,-Wunreachable-code-return]
  return 0;
         ^
dom/fetch/FetchDriver.cpp:252:10: error: 'return' will never be executed [-Werror,-Wunreachable-code-return]
  return NS_OK;
         ^~~~~

Differential Revision: https://phabricator.services.mozilla.com/D126870
2021-09-29 21:44:51 +00:00
Marian-Vasile Laza
381c254e6d Backed out 3 changesets (bug 1487113) for causing hazard bustages. CLOSED TREE
Backed out changeset 13bf04fc644f (bug 1487113)
Backed out changeset 5b7fe5d564aa (bug 1487113)
Backed out changeset 02236ccd64b4 (bug 1487113)
2021-09-17 22:58:33 +03:00
Yury Delendik
b8f6bd6a71 Bug 1487113 - Add pref javascript.options.wasm_caching. r=necko-reviewers,valentin
Differential Revision: https://phabricator.services.mozilla.com/D27101
2021-09-17 12:16:24 +00:00
Yury Delendik
21eebdf064 Bug 1487113 - Use alt-data to cache stream-compiled WebAssembly modules. r=necko-reviewers,valentin,dragana
Depends on D117360

Differential Revision: https://phabricator.services.mozilla.com/D26731
2021-09-17 12:16:24 +00:00
Yury Delendik
19b0d24e7f Bug 1487113 - nsICacheInfoChannel.alternativeDataInputStream as attribute. r=necko-reviewers,valentin
Differential Revision: https://phabricator.services.mozilla.com/D117360
2021-09-17 12:16:23 +00:00
Cristian Tuns
f2f6eac4d6 Backed out 3 changesets (bug 1487113) for causing mochitest failures. CLOSED TREE
Backed out changeset b20e5d76c77e (bug 1487113)
Backed out changeset b0b2b27dcb68 (bug 1487113)
Backed out changeset 9214b396eb84 (bug 1487113)
2021-09-14 17:38:32 -04:00
Yury Delendik
f03ccb4ccd Bug 1487113 - Add pref javascript.options.wasm_caching. r=necko-reviewers,valentin
Differential Revision: https://phabricator.services.mozilla.com/D27101
2021-09-14 20:12:52 +00:00