Commit Graph

329 Commits

Author SHA1 Message Date
Alex Hochheiden
9e91a1f021 Bug 1715287 - [lint] Enable remaining pyupgrade rules and lint tree r=linter-reviewers,webdriver-reviewers,translations-reviewers,whimboo,sylvestre
Differential Revision: https://phabricator.services.mozilla.com/D245320
2025-04-13 17:48:23 +00:00
Benjamin VanderSloot
b687f6b23b Bug 1937121, part 1 - Remove storage unpartitioning from dom tests - r=smaug
Similar to another recent patch, this removes uses of
SimpleTest.enableLegacyUnpartitionedStorage for the new BroadcastChannel.unpartitionedTestingChannel.

One exception is test_bug458091.html, which I just disable for xorigin.
It really doesn't need the xorigin coverage imo. It is testing that
sessionStorage uses principals, not just the Document URI.

Differential Revision: https://phabricator.services.mozilla.com/D242942
2025-04-07 12:37:46 +00:00
aiunusov@mozilla.com
e72f90fe41 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
Anutrix
eb3f1dd3e2 Bug 1954222 - Removed usage of six in dom directory. r=firefox-build-system-reviewers,sergesanspaille
Differential Revision: https://phabricator.services.mozilla.com/D241708
2025-03-26 06:58:42 +00:00
Cristina Horotan
314627c40c Backed out changeset 35386ee5916e (bug 1954222) for causing mochitest failures at test_websocket5.html on a CLOSED TREE 2025-03-23 03:23:31 +02:00
Anutrix
e661ed22b0 Bug 1954222 - Removed usage of six in dom directory. r=firefox-build-system-reviewers,sergesanspaille
Differential Revision: https://phabricator.services.mozilla.com/D241708
2025-03-22 21:04:56 +00:00
Butkovits Atila
9cba45fb33 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
7e86c06186 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
Benjamin VanderSloot
1e923b7ea6 Bug 1922020, part 7 - Remove reliance on window.opener storage access heuristic in user.js from dom/websocket/tests/test_bug1384658.html - r=valentin
Differential Revision: https://phabricator.services.mozilla.com/D224812
2024-10-30 12:19:43 +00:00
Matthew Gaudet
f753b8986b 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
Gregory Pappas
5a83ad063c Bug 1912434 - Remove network.websocket.extensions.permessage-deflate pref r=necko-reviewers,kershaw
Differential Revision: https://phabricator.services.mozilla.com/D222901
2024-09-20 09:28:45 +00:00
Mark Banner
9f5c682861 Bug 1914620 - Enable remaining ESLint rules for dom/websocket. r=necko-reviewers,frontend-codestyle-reviewers,jesup
Differential Revision: https://phabricator.services.mozilla.com/D219976
2024-08-28 11:23:08 +00:00
Mark Banner
e9f9ae775c Bug 1914620 - Enable ESLint rules no-undef and no-unused-vars on dom/websocket. r=necko-reviewers,frontend-codestyle-reviewers,jesup
Differential Revision: https://phabricator.services.mozilla.com/D219975
2024-08-28 11:23:08 +00:00
Peter Van der Beken
b0d751d865 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
77c40caac6 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
a44b49af0b 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
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