Commit graph

232 commits

Author SHA1 Message Date
Tom Schuster
c425bf7332 Bug 1967417 - Create a fallible LoadInfo factory. r=smaug,necko-reviewers,places-reviewers,kershaw
Differential Revision: https://phabricator.services.mozilla.com/D250182
2025-05-21 15:21:52 +00:00
Serban Stanca
74eb44d641 Revert "Bug 1967417 - Create a fallible LoadInfo factory. r=smaug,necko-reviewers,places-reviewers,kershaw" for causing multiple failures.
This reverts commit b9a9491a35823ebefc9cf171cc03f6830898bb59.
2025-05-21 13:34:54 +00:00
Tom Schuster
cc25c34198 Bug 1967417 - Create a fallible LoadInfo factory. r=smaug,necko-reviewers,places-reviewers,kershaw
Differential Revision: https://phabricator.services.mozilla.com/D250182
2025-05-21 12:24:10 +00:00
aiunusov@mozilla.com
60e46cc51e Bug 1944883 - Part 1: implement missing HasOpenWebSockets(), r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D236195
2025-04-01 14:11:51 +00:00
Butkovits Atila
5cdd685956 Backed out changeset aaa763c4954a (bug 1951698) for causing failures at dedicatedworker-connect-src.html. CLOSED TREE 2025-03-11 12:19:32 +02:00
Frederik Braun
82abd5ae29 Bug 1951698 - WebSocket blocked by CSP shouldn't throw r=necko-reviewers,valentin
Differential Revision: https://phabricator.services.mozilla.com/D240870
2025-03-11 09:17:41 +00:00
Matthew Gaudet
cfd64173df Bug 1924888 - Swap order of arguments to DescribeScriptedCaller r=sfink
It's not a standard exception throwing JSAPI function. The one caveat here is
that I couldn't put JSContext in last position: There are default params to
preserve. So instead it's in second position, which still communicates that
it's not an exception throwing function

Differential Revision: https://phabricator.services.mozilla.com/D225726
2024-10-16 15:58:19 +00:00
Peter Van der Beken
5a5ef4beda 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-08-21 08:43:09 +00:00
Emilio Cobos Álvarez
e1ad6294bf Bug 1910698 - Remove nsIScriptError.sourceLine. r=smaug,devtools-reviewers,webdriver-reviewers,necko-reviewers,nchevobbe,kershaw,jdescottes,credential-management-reviewers,dimi
Afaict the source lines are not exposed anywhere in the UI.

Differential Revision: https://phabricator.services.mozilla.com/D218115
2024-08-01 17:12:48 +00:00
Emilio Cobos Álvarez
198c331213 Bug 1910698 - Add a struct to represent JS caller location and more general warning source location. r=smaug,necko-reviewers,anti-tracking-reviewers,dom-storage-reviewers,pbz,kershaw,janv
Use it liberally across the tree. This could be cleaned up even more in the future.

Differential Revision: https://phabricator.services.mozilla.com/D218114
2024-08-01 17:12:48 +00:00
Kagami Sascha Rosylight
6a6aa2abdc 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
11cd73d7a7 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
a630b88fff 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
98b0f1c3d6 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
4ffa6418bb 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
da208da98f 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
6613ec7689 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
8021d46fcb 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
2f65cf28ae 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
8f38838e6e 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
e22d6ca385 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
a4a855b0e3 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
4b94532a31 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
Stanca Serban
c3672410f7 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
3d9e128594 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
a2709c2f0e 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
1dbadb53c7 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
741982b984 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
2594dc03cd 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
5064e6c34d 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
b94e95b889 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
346cecd51c 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
0e77e52b38 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
76d5680b9b 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
5050d77483 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
b0e0b34ea6 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
90a1a93d02 Backed out changeset 5bb6f99c6029 (bug 1868177) for causing multiple failures related to websocket. 2023-12-05 05:40:59 +02:00
Randell Jesup
4faadd5909 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
c7c9a42f7c 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
2a425d001a 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
Peter Van der Beken
1af728d973 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
244ca5ae28 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
8c59289f4f 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
705aa81869 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
24c1f43199 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
a4a513ad86 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
76d6e6b69c 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
c8916f8e8e 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
Emilio Cobos Álvarez
25c0d10932 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
692c851b42 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