WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
Bug 239122
Shared workers should match service worker registrations
https://bugs.webkit.org/show_bug.cgi?id=239122
Summary
Shared workers should match service worker registrations
youenn fablet
Reported
2022-04-12 05:37:07 PDT
Shared workers should match service worker registrations
Attachments
Patch
(65.04 KB, patch)
2022-04-12 05:40 PDT
,
youenn fablet
no flags
Details
Formatted Diff
Diff
Patch
(65.56 KB, patch)
2022-04-14 02:30 PDT
,
youenn fablet
no flags
Details
Formatted Diff
Diff
Patch
(66.11 KB, patch)
2022-04-14 06:24 PDT
,
youenn fablet
ews-feeder
: commit-queue-
Details
Formatted Diff
Diff
Patch
(68.55 KB, patch)
2022-04-14 08:17 PDT
,
youenn fablet
no flags
Details
Formatted Diff
Diff
Patch
(68.65 KB, patch)
2022-04-15 00:17 PDT
,
youenn fablet
no flags
Details
Formatted Diff
Diff
Patch for landing
(67.47 KB, patch)
2022-04-21 06:37 PDT
,
youenn fablet
no flags
Details
Formatted Diff
Diff
Fix remote worker process change
(80.23 KB, patch)
2022-04-22 03:14 PDT
,
youenn fablet
no flags
Details
Formatted Diff
Diff
Fix remote worker process change
(80.23 KB, patch)
2022-04-22 05:56 PDT
,
youenn fablet
no flags
Details
Formatted Diff
Diff
Rebasing
(80.45 KB, patch)
2022-04-22 07:15 PDT
,
youenn fablet
no flags
Details
Formatted Diff
Diff
Patch
(81.77 KB, patch)
2022-04-26 02:37 PDT
,
youenn fablet
no flags
Details
Formatted Diff
Diff
Rebasing
(81.81 KB, patch)
2022-04-26 04:52 PDT
,
youenn fablet
ews-feeder
: commit-queue-
Details
Formatted Diff
Diff
Fix build
(81.83 KB, patch)
2022-04-26 05:04 PDT
,
youenn fablet
no flags
Details
Formatted Diff
Diff
Fix WinCairo
(81.94 KB, patch)
2022-04-26 23:17 PDT
,
youenn fablet
ews-feeder
: commit-queue-
Details
Formatted Diff
Diff
Fix WinCairo
(81.95 KB, patch)
2022-04-26 23:52 PDT
,
youenn fablet
no flags
Details
Formatted Diff
Diff
Show Obsolete
(13)
View All
Add attachment
proposed patch, testcase, etc.
youenn fablet
Comment 1
2022-04-12 05:40:37 PDT
Created
attachment 457327
[details]
Patch
youenn fablet
Comment 2
2022-04-14 02:30:15 PDT
Created
attachment 457605
[details]
Patch
youenn fablet
Comment 3
2022-04-14 06:24:32 PDT
Created
attachment 457619
[details]
Patch
youenn fablet
Comment 4
2022-04-14 08:17:23 PDT
Created
attachment 457631
[details]
Patch
youenn fablet
Comment 5
2022-04-15 00:17:09 PDT
Created
attachment 457680
[details]
Patch
Chris Dumez
Comment 6
2022-04-15 07:32:16 PDT
Comment on
attachment 457680
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=457680&action=review
r=me
> Source/WebCore/workers/service/SWClientConnection.cpp:134 > + worker->postTaskToWorkerGlobalScope([message = WTFMove(message), sourceData = WTFMove(sourceData), sourceOrigin = WTFMove(sourceOrigin).isolatedCopy()] (auto& context) mutable {
WTFMove(sourceData).isolatedCopy() Let the optimization in `ServiceWorkerData isolatedCopy() &&;` determine if moving is safe.
> Source/WebCore/workers/service/SWClientConnection.cpp:141 > + sharedWorker->thread().runLoop().postTask([message = WTFMove(message), sourceData = WTFMove(sourceData), sourceOrigin = WTFMove(sourceOrigin).isolatedCopy()] (auto& context) mutable {
WTFMove(sourceData).isolatedCopy()
> Source/WebCore/workers/shared/context/SharedWorkerThreadProxy.cpp:54 > + static NeverDestroyed<HashMap<ScriptExecutionContextIdentifier, SharedWorkerThreadProxy*>> map;
Should probably use MainThreadNeverDestroyed.
> Source/WebCore/workers/shared/context/SharedWorkerThreadProxy.cpp:93 > + , m_clientIdentifier(*initializationData.clientIdentifier)
use-after-move of initializationData. While this may work in practice, it looks unsafe and should be avoided.
> Source/WebCore/workers/shared/context/SharedWorkerThreadProxy.h:88 > + ScriptExecutionContextIdentifier m_clientIdentifier;
I am a bit unclear about what this means. A sharedWorker doesn't necessarily have a single client.
youenn fablet
Comment 7
2022-04-15 07:53:54 PDT
> > Source/WebCore/workers/shared/context/SharedWorkerThreadProxy.cpp:93 > > + , m_clientIdentifier(*initializationData.clientIdentifier) > > use-after-move of initializationData. While this may work in practice, it > looks unsafe and should be avoided. > > > Source/WebCore/workers/shared/context/SharedWorkerThreadProxy.h:88 > > + ScriptExecutionContextIdentifier m_clientIdentifier; > > I am a bit unclear about what this means. A sharedWorker doesn't necessarily > have a single client.
It is the id of the shared worker context, exposed as client.id.
Chris Dumez
Comment 8
2022-04-15 07:59:32 PDT
(In reply to youenn fablet from
comment #7
)
> > > Source/WebCore/workers/shared/context/SharedWorkerThreadProxy.cpp:93 > > > + , m_clientIdentifier(*initializationData.clientIdentifier) > > > > use-after-move of initializationData. While this may work in practice, it > > looks unsafe and should be avoided. > > > > > Source/WebCore/workers/shared/context/SharedWorkerThreadProxy.h:88 > > > + ScriptExecutionContextIdentifier m_clientIdentifier; > > > > I am a bit unclear about what this means. A sharedWorker doesn't necessarily > > have a single client. > > It is the id of the shared worker context, exposed as client.id.
I see but the naming is confusing in the context of a shared worker when we say "client". I thought you meant client of the shared worker. When you meant that the shared worker is the client of the service worker. Not sure how to clarify though.
Chris Dumez
Comment 9
2022-04-15 08:00:08 PDT
(In reply to Chris Dumez from
comment #8
)
> (In reply to youenn fablet from
comment #7
) > > > > Source/WebCore/workers/shared/context/SharedWorkerThreadProxy.cpp:93 > > > > + , m_clientIdentifier(*initializationData.clientIdentifier) > > > > > > use-after-move of initializationData. While this may work in practice, it > > > looks unsafe and should be avoided. > > > > > > > Source/WebCore/workers/shared/context/SharedWorkerThreadProxy.h:88 > > > > + ScriptExecutionContextIdentifier m_clientIdentifier; > > > > > > I am a bit unclear about what this means. A sharedWorker doesn't necessarily > > > have a single client. > > > > It is the id of the shared worker context, exposed as client.id. > > I see but the naming is confusing in the context of a shared worker when we > say "client". I thought you meant client of the shared worker. When you > meant that the shared worker is the client of the service worker. Not sure > how to clarify though.
Maybe it should be m_contextIdentifier?
Radar WebKit Bug Importer
Comment 10
2022-04-19 05:38:12 PDT
<
rdar://problem/91954369
>
youenn fablet
Comment 11
2022-04-21 03:16:18 PDT
> Maybe it should be m_contextIdentifier?
Sounds good.
youenn fablet
Comment 12
2022-04-21 06:37:10 PDT
Created
attachment 458056
[details]
Patch for landing
youenn fablet
Comment 13
2022-04-22 03:14:37 PDT
Created
attachment 458130
[details]
Fix remote worker process change
youenn fablet
Comment 14
2022-04-22 05:56:13 PDT
Created
attachment 458139
[details]
Fix remote worker process change
youenn fablet
Comment 15
2022-04-22 07:15:37 PDT
Created
attachment 458144
[details]
Rebasing
youenn fablet
Comment 16
2022-04-26 02:37:40 PDT
Created
attachment 458347
[details]
Patch
youenn fablet
Comment 17
2022-04-26 04:52:54 PDT
Created
attachment 458351
[details]
Rebasing
youenn fablet
Comment 18
2022-04-26 05:04:00 PDT
Created
attachment 458353
[details]
Fix build
youenn fablet
Comment 19
2022-04-26 23:17:55 PDT
Created
attachment 458420
[details]
Fix WinCairo
youenn fablet
Comment 20
2022-04-26 23:52:10 PDT
Created
attachment 458423
[details]
Fix WinCairo
EWS
Comment 21
2022-04-27 01:22:32 PDT
Committed
r293501
(
250032@main
): <
https://commits.webkit.org/250032@main
> All reviewed patches have been landed. Closing bug and clearing flags on
attachment 458423
[details]
.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug