Commit Graph

313 Commits

Author SHA1 Message Date
Kagami Sascha Rosylight
e03c7d5cef Bug 1908729 - Part 3: Replace nsIObserver with GlobalObservers in WebSocket r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D217129
2024-07-30 13:54:00 +00:00
Stanca Serban
68116687ca Backed out 6 changesets (bug 1900930) for causing xpcshell assertion failures in ErrorResult.h. CLOSED TREE
Backed out changeset 5234a13894b2 (bug 1900930)
Backed out changeset 638842494167 (bug 1900930)
Backed out changeset 36695bae43ed (bug 1900930)
Backed out changeset 23ab72aa4589 (bug 1900930)
Backed out changeset c89109c12d59 (bug 1900930)
Backed out changeset 2d3f52edb98a (bug 1900930)
2024-07-25 13:53:53 +03:00
Peter Van der Beken
dfe3258373 Bug 1900930 - Make ENSURE_SUCCESS call WouldReportJSException. r=dom-core,win-reviewers,emilio,gstoll,edgar
Making ENSURE_SUCCESS return the result of StealNSResult() ensures that
exceptions in the ErrorResult are deal with. We can then signal that through
WouldReportJSException.

Differential Revision: https://phabricator.services.mozilla.com/D214792
2024-07-25 07:40:40 +00:00
Kagami Sascha Rosylight
4573d3fb90 Bug 1908947 - Add WorkerPrivate::GetTopLevelWorker() r=asuth
Differential Revision: https://phabricator.services.mozilla.com/D217139
2024-07-23 13:46:45 +00:00
Emilio Cobos Álvarez
71bf77b3fe Bug 1904442 - Rename GlobalTeardownObserver::GetOwner to GetOwnerWindow. r=smaug,media-playback-reviewers,dom-storage-reviewers,aosmond,padenot,asuth
Also HasOrHasHadOwner to HasOrHasHadOwnerWindow.

Differential Revision: https://phabricator.services.mozilla.com/D214772
2024-07-01 11:49:59 +00:00
Eden Chuang
feb314e721 Bug 1894231 - P3 Remove WorkerPrivate* in WorkerMainThreadRunnable. r=dom-worker-reviewers,extension-reviewers,smaug,rpl
Remove mWorkerPrivate from WorkerMainThreadRunnable. Instead, using a ThreadSafeWorkerRef to keep Worker alive until the created syncLoop is destroyed.

In general, WorkerMainThreadRunnable::mWorkerPrivate is only used for dispatching the MainThreadStopSyncLoopRunnable back to the Worker thread. Because of the syncLoop, the Worker is supposed to be kept alive until the created syncLoop is destroyed.

RefPtr<ThreadSafeWorkerRef> WorkerMainThreadRunnable::mWorkerRef is introduced to ensure a valid WorkerPrivate during WorkerMainThreadRunnable's execution.

WorkerMainThreadRunnable::mWorkerRef is allocated just before creating a syncLoop in WorkerMainThreadRunnable::Dispatch. And released after the created syncLoop::Run() finishes.

Depends on D212556

Differential Revision: https://phabricator.services.mozilla.com/D212557
2024-06-24 22:20:51 +00:00
Tom Schuster
feaa0c77a1 Bug 1904004 - Use OriginAttributes::IsPrivateBrowsing instead of open coding PBM checks. r=timhuang,cookie-reviewers,anti-tracking-reviewers,profiler-reviewers,necko-reviewers,kershaw,dom-storage-reviewers,janv,canaltinova,dom-worker-reviewers,asuth
Differential Revision: https://phabricator.services.mozilla.com/D214532
2024-06-24 11:06:18 +00:00
Valentin Gosu
4241464224 Bug 1785678 - Move IsValidProtocolString check earlier r=necko-reviewers,kershaw
We should check the valid protocol before we actually instantiate WebSocketImplProxy

Differential Revision: https://phabricator.services.mozilla.com/D208596
2024-04-25 19:14:57 +00:00
Eden Chuang
a718e4758f Bug 1769913 - P3 Remove WorkerRunnable::mWorkerPrivate. r=dom-worker-reviewers,asuth
WorkerRunnable no longer keeps a raw pointer(mWorkerPrivate) for the associated WorkerPrivate in this patch.
Removing the WorkerRunnable::mWorkerPrivate needs to fix the following problems.

1. Thread assertions in WorkerRunnable::Dispatch()

To fix this problem, the associated WorkerPrivate is as a parameter and passed to WorkerRunnable::Dispatch() for the dispatching thread assertions. This associated WorkerPrivate is also propagated to PreDispatch() and PostDispatch() for the children classes of WorkerRunnable()

2. Get the associated WorkerPrivate in WorkerRunnable::Run() for environment setup(GlobabObject, JSContext setting for the runnable)

- For WorkerThreadRunnable

Since WorkerThreadRunnable is supposed to run on the worker thread, it does not need to keep a raw pointer to WorkerPrivate as its class member. GetCurrentThreadWorkerPrivate() should always get the correct WorkerPrivate for WorkerThreadRunnable.

- For WorkerParentThreadRunnable

WorkerParentRef is introduced to keep a RefPtr<WorkerPrivate> for WorkerParentThreadRunnable instead of using a raw pointer.
Checking the associated WorkerPrivate existence by WorkerParentRef at the beginning of WorkerParentThreadRunnable::Run(). If the Worker has already shut down, WorkerParentThreadRunnable cannot do anything with the associated WorkerPrivate, so WorkerParentThreadRunnable::Run() will return NS_OK directly but with a warning.

The associated WorkerPrivate is also passed into WorkerRun(), PreRun(), and PostRun(), so the majority of implementations of child classes of WorkerRunnable do not need to be changed.

If there are any cases in which the child classes of WorkerThreadRunnable/WorkerParentThreadRunnable want to keep the associated WorkerPrivate, they should use WorkerRefs instead of raw pointers.

Depends on D205679

Differential Revision: https://phabricator.services.mozilla.com/D207039
2024-04-19 09:41:58 +00:00
Eden Chuang
11d8c5840b Bug 1769913 - P2 WorkerParentThreadRunnable for the runnables dispatched to worker's parent thread. r=dom-worker-reviewers,asuth
In this patch, WorkerParentThreadRunnable is extracted from WorkerThreadRunnable for runnable on the parent thread.

WorkerParentControlRunnable and WorkerParentDebuggeeRunnable are also created for control runnable and debuggee runnable on the parent thread.

Instead of using WorkerRunnable::Target to indicate the thread target, inheriting WorkerThreadRunnable or WorkerParentThreadRunnable to point out that this runnable should run on the worker thread or on the parent thread. So WorkerRunnable::Target is removed in this patch.

This patch also move the dispatching logic into WorkerPrivate to simplify WorkerRunnable::DispatchInternal()'s implementation.

Depends on D205178

Differential Revision: https://phabricator.services.mozilla.com/D205679
2024-04-19 09:41:57 +00:00
Eden Chuang
f9b64790d7 Bug 1769913 - P1 Make WorkerRunnable to be a base class for runnables on Worker thread and Worker's parent thread. r=dom-worker-reviewers,asuth
This is the first step in splitting the parent thread runnable out of WorkerRunnable.

To reuse the runnable dispatching codes in Worker, we still need a base class for runnable on the worker thread and the parent thread.

In this patch, we rename the original WorkerRunnable to WorkerThreadRunnable and make WorkerRunnable to be WorkerThreadRunnable's parent class.

In the second patch, we will create WorkerParentThreadRunnable and its sub-classes, split from WorkerThreadRunnable for runnable on the Worker's parent thread.

And in the third patch, we will re-structure the content of WorkerParentThreadRunnable to remove unnecessary members.

Differential Revision: https://phabricator.services.mozilla.com/D205178
2024-04-19 09:41:57 +00:00
Jens Stutte
f3c15c2cc5 Bug 1880233 - Add names to MainThreadWorkerRunnable derived runnables. r=dom-worker-reviewers,asuth
Differential Revision: https://phabricator.services.mozilla.com/D201812
2024-02-14 16:13:24 +00:00
Kershaw Chang
d5491c27db Bug 1877744 - Make sure WebSocketImpl::OnStart is called on target thread, r=necko-reviewers,valentin
Differential Revision: https://phabricator.services.mozilla.com/D200368
2024-02-12 10:12:04 +00:00
Valentin Gosu
4752205d6a Bug 1856719 - Make websocket server listen on all interfaces to make Android tests work r=necko-reviewers,kershaw
- Makes websocket server listen on all interfaces (0.0.0.0) - this made tests pass locally on the emulator.
- Pass 127.0.0.1 as the websocketserver address in the ssltunnel config. This makes rewriting the address work
- Remaining tests are using HTTPS/WSS and they're failing probably due to a bug in ssltunnel

Differential Revision: https://phabricator.services.mozilla.com/D194908
2024-02-09 16:24:08 +00:00
Stanca Serban
58d86ac222 Backed out changeset 6ab0ac80ff45 (bug 1877744) for causing build bustages in WebSocket.cpp. CLOSED TREE 2024-02-06 15:25:17 +02:00
Kershaw Chang
a5abf56ccd Bug 1877744 - Make sure WebSocketImpl::OnStart is called on target thread, r=necko-reviewers,valentin
Differential Revision: https://phabricator.services.mozilla.com/D200368
2024-02-06 12:32:14 +00:00
Jens Stutte
aa54dcc26f Bug 1875800 - Add name support to WorkerRunnable. r=dom-worker-reviewers,asuth,smaug
Differential Revision: https://phabricator.services.mozilla.com/D199228
2024-01-24 16:00:26 +00:00
Oliver Medhurst
1c7df732ee Bug 1797449 - [websocket] Allow relative URLs and http(s) scheme r=valentin
Add support to WebSocket for http: and https: URLs,
as well as having them be relative to a base URI.

Spec: https://github.com/whatwg/websockets/issues/20

Passes new WPT tests for this in /websockets, with other tests unaffected.

Also updated our tests to expect these URLs to be successful instead of fail.

Differential Revision: https://phabricator.services.mozilla.com/D160330
2024-01-23 17:23:17 +00:00
Cristian Tuns
5de093dcd2 Backed out changeset f3efca74da0f (bug 1875800) for causing build bustages in WorkerPrivate.cpp CLOSED TREE 2024-01-23 11:20:38 -05:00
Jens Stutte
926a1907f0 Bug 1875800 - Add name support to WorkerRunnable. r=dom-worker-reviewers,asuth
Differential Revision: https://phabricator.services.mozilla.com/D199228
2024-01-23 11:23:41 +00:00
Norisz Fay
eef07384eb Backed out changeset f27806eac17b (bug 1797449) for causing mochitest failure on test_websocket1.html CLOSED TREE 2024-01-23 00:42:33 +02:00
Oliver Medhurst
5d05bb6e18 Bug 1797449 - [websocket] Allow relative URLs and http(s) scheme r=valentin
Add support to WebSocket for http: and https: URLs,
as well as having them be relative to a base URI.

Spec: https://github.com/whatwg/websockets/issues/20

Passes new WPT tests for this in /websockets, with other tests unaffected.

Differential Revision: https://phabricator.services.mozilla.com/D160330
2024-01-22 19:06:50 +00:00
Tom Schuster
694c3e8534 Bug 1872839 - Remove aMimeTypeGuess parameter from nsIContentPolicy. r=freddyb
Differential Revision: https://phabricator.services.mozilla.com/D197794
2024-01-08 15:47:42 +00:00
Randell Jesup
53da39b931 Bug 1868177: Add ProofOfRef arguments to WebSocketImpl methods r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D195346
2023-12-08 03:34:09 +00:00
Peter Van der Beken
fd17a13d91 Bug 1867945 - Use WeakPtr<Document> instead of nsWeakPtr. r=dom-core,farre
Differential Revision: https://phabricator.services.mozilla.com/D195342
2023-12-07 18:47:44 +00:00
Iulian Moraru
18a0b69f80 Backed out changeset f03b7de13ed6 (bug 1867945) for causing leaks at WeakReference. CLOSED TREE 2023-12-07 16:24:40 +02:00
Peter Van der Beken
6f18106eee Bug 1867945 - Use WeakPtr<Document> instead of nsWeakPtr. r=dom-core,farre
Differential Revision: https://phabricator.services.mozilla.com/D195342
2023-12-07 13:42:07 +00:00
Iulian Moraru
8a48709911 Backed out changeset 5bb6f99c6029 (bug 1868177) for causing multiple failures related to websocket. 2023-12-05 05:40:59 +02:00
Randell Jesup
58afdd1d44 Bug 1868177: Add ProofOfRef arguments to WebSocketImpl methods r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D195346
2023-12-04 22:26:45 +00:00
Olli Pettay
e009a8d834 Bug 1846328, follow COM-rules when calling impl methods, r=jesup
Differential Revision: https://phabricator.services.mozilla.com/D195337
2023-12-04 16:40:04 +00:00
Olli Pettay
60c451e6af Bug 1867927 - WebSocketImpl::Dispatch may try to dispatch to main thread too late, r=jesup
Differential Revision: https://phabricator.services.mozilla.com/D195336
2023-12-03 19:43:01 +00:00
Kershaw Chang
ddaf45d103 Bug 1867006 - Disable HTTP2 websockets until we can resolve proxy issues. r=necko-reviewers,valentin
Differential Revision: https://phabricator.services.mozilla.com/D194871
2023-11-29 13:13:07 +00:00
Peter Van der Beken
c91995aee6 Bug 1866008 - Remove nsContentUtils::CreateArrayBuffer. r=farre
Differential Revision: https://phabricator.services.mozilla.com/D194460
2023-11-24 08:46:22 +00:00
Tooru Fujisawa
2b4f7eecab Bug 1864168 - Part 4: Use 1-origin column number for WebSocket-related console message. r=smaug,devtools-reviewers,ochameau
Differential Revision: https://phabricator.services.mozilla.com/D193372
2023-11-22 12:31:32 +00:00
Tooru Fujisawa
209a1f050c Bug 1864168 - Part 1: Use 1-origin column number in nsIContentSecurityPolicy. r=smaug,devtools-reviewers,ochameau,ckerschb
Differential Revision: https://phabricator.services.mozilla.com/D193369
2023-11-22 12:31:30 +00:00
Natalia Csoregi
e0d56104a6 Backed out 14 changesets (bug 1865005, bug 1864168, bug 1864155, bug 1862814, bug 1862693) for causing bustage on nsRFPService.cpp. CLOSED TREE
Backed out changeset a4f3e7625abf (bug 1865005)
Backed out changeset ab38141e470b (bug 1862814)
Backed out changeset a679b50dc4a9 (bug 1862814)
Backed out changeset e340886ce62a (bug 1862814)
Backed out changeset 1378502e64b0 (bug 1862814)
Backed out changeset 8ee94e5e79c2 (bug 1862814)
Backed out changeset 6d4ef1cdfabb (bug 1864168)
Backed out changeset 2c30c4d757fc (bug 1864168)
Backed out changeset d4db9576559b (bug 1864168)
Backed out changeset 8ffec0d83028 (bug 1864168)
Backed out changeset fa77d852b494 (bug 1864168)
Backed out changeset f6646771a26a (bug 1864168)
Backed out changeset 7bd0ff6986df (bug 1864155)
Backed out changeset 39867b503289 (bug 1862693)
2023-11-22 14:01:55 +02:00
Tooru Fujisawa
be7646b9a8 Bug 1864168 - Part 4: Use 1-origin column number for WebSocket-related console message. r=smaug,devtools-reviewers,ochameau
Differential Revision: https://phabricator.services.mozilla.com/D193372
2023-11-22 11:13:55 +00:00
Tooru Fujisawa
676bd2ea73 Bug 1864168 - Part 1: Use 1-origin column number in nsIContentSecurityPolicy. r=smaug,devtools-reviewers,ochameau,ckerschb
Differential Revision: https://phabricator.services.mozilla.com/D193369
2023-11-22 11:13:54 +00:00
Eden Chuang
5ca02c8ea0 Bug 1836700 - Remove BusyCount of WorkerPrivate. r=asuth,ipc-reviewers,mccr8
Differential Revision: https://phabricator.services.mozilla.com/D182718
2023-11-13 04:00:40 +00:00
Tooru Fujisawa
8b51569f3f Bug 1862692 - Part 16: Use 1-origin column number type in JS::DescribeScriptedCaller. r=iain
Differential Revision: https://phabricator.services.mozilla.com/D193029
2023-11-09 11:41:10 +00:00
Tom Marble
9c1ce1f8cc Bug 1855298 - convert .ini manifests to .toml: batch 10 dom/[t-z]**/mochitest.ini r=jmaher
Differential Revision: https://phabricator.services.mozilla.com/D190089
2023-10-25 15:54:48 +00:00
Narcis Beleuzu
98609f1ad3 Backed out changeset eac298199d7b (bug 1855298) for Linting failure. CLOSED TREE 2023-10-12 01:44:24 +03:00
Tom Marble
07dbb5ab0c Bug 1855298 - convert .ini manifests to .toml: batch 10 dom/[t-z]**/mochitest.ini r=jmaher
Differential Revision: https://phabricator.services.mozilla.com/D190089
2023-10-11 20:51:09 +00:00
Emilio Cobos Álvarez
d02e297b2d Bug 1624819 - Remove TaskCategory and other quantum dom remnants. r=smaug,media-playback-reviewers,credential-management-reviewers,cookie-reviewers,places-reviewers,win-reviewers,valentin,mhowell,sgalich,alwu
Sorry this is not a particularly easy patch to review. But it should be
mostly straight-forward.

I kept Document::Dispatch mostly for convenience, but could be
cleaned-up too / changed by SchedulerGroup::Dispatch. Similarly maybe
that can just be NS_DispatchToMainThread if we add an NS_IsMainThread
check there or something (to preserve shutdown semantics).

Differential Revision: https://phabricator.services.mozilla.com/D190450
2023-10-10 08:51:12 +00:00
june wilde
a7816eb659 Bug 1844646 - Add check for data and blob URIs in WebSocketImpl::IsSecure; r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D184954
2023-09-29 22:26:04 +00:00
Peter Van der Beken
e664ec3758 Bug 1690111 - Use new TypedArray APIs for processing data. r=farre,media-playback-reviewers,padenot,chunmin,sfink
Depends on D152497

Differential Revision: https://phabricator.services.mozilla.com/D152498
2023-09-20 09:42:02 +00:00
Peter Van der Beken
2ba4663c86 Bug 1690111 - Use new TypedArray APIs for appending data to a container. r=farre,extension-reviewers,media-playback-reviewers,kmag,alwu,padenot
Depends on D152494

Differential Revision: https://phabricator.services.mozilla.com/D152495
2023-09-20 09:42:01 +00:00
Tom Marble
d70780c99c Bug 1850545 - convert .ini manifests to .toml: batch 3 chrome.ini (bis) r=jmaher,geckoview-reviewers,extension-reviewers,credential-management-reviewers,devtools-reviewers,fxview-reviewers,places-reviewers,profiler-reviewers,m_kato,mak,mtigley
Differential Revision: https://phabricator.services.mozilla.com/D187597
2023-09-13 18:28:32 +00:00
Cosmin Sabou
c3effd7450 Backed out 13 changesets (bug 1690111) for causing fetch related crashes.
Backed out changeset 5f2c25d194ad (bug 1690111)
Backed out changeset 76c408bcd053 (bug 1690111)
Backed out changeset 6d0649fdafff (bug 1690111)
Backed out changeset c1330b5e8c43 (bug 1690111)
Backed out changeset 5fa36d8fd2a5 (bug 1690111)
Backed out changeset daf7d747853a (bug 1690111)
Backed out changeset f70e09a7f5c6 (bug 1690111)
Backed out changeset 40c6d6eed7f8 (bug 1690111)
Backed out changeset 692f2a759573 (bug 1690111)
Backed out changeset 7140866dd9f6 (bug 1690111)
Backed out changeset 2865fe682139 (bug 1690111)
Backed out changeset 9dcd2416f8a5 (bug 1690111)
Backed out changeset 9c411bf84079 (bug 1690111)
2023-09-11 17:55:24 +03:00
Peter Van der Beken
312137a408 Bug 1690111 - Use new TypedArray APIs for processing data. r=farre,media-playback-reviewers,padenot,chunmin,sfink
Depends on D152497

Differential Revision: https://phabricator.services.mozilla.com/D152498
2023-09-11 12:52:20 +00:00