Bug 180669

Summary: Merge ServiceWorkerClientIdentifier into ServiceWorkerClientData
Product: WebKit Reporter: Chris Dumez <cdumez>
Component: WebCore Misc.Assignee: Chris Dumez <cdumez>
Status: RESOLVED FIXED    
Severity: Normal CC: beidson, commit-queue, dbates, esprehn+autocc, ews-watchlist, kangil.han, webkit-bug-importer, youennf
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
See Also: https://bugs.webkit.org/show_bug.cgi?id=180683
Attachments:
Description Flags
Patch
none
Patch
none
Patch none

Chris Dumez
Reported 2017-12-11 13:49:33 PST
Merge ServiceWorkerClientIdentifier into ServiceWorkerCientData, for consistency with ServiceWorkerIdentifier / ServiceWorkerData, and start simplifying the postMessage() code.
Attachments
Patch (69.36 KB, patch)
2017-12-11 13:58 PST, Chris Dumez
no flags
Patch (69.37 KB, patch)
2017-12-11 14:00 PST, Chris Dumez
no flags
Patch (68.52 KB, patch)
2017-12-11 15:08 PST, Chris Dumez
no flags
Chris Dumez
Comment 1 2017-12-11 13:58:57 PST
Chris Dumez
Comment 2 2017-12-11 14:00:25 PST
youenn fablet
Comment 3 2017-12-11 14:56:22 PST
Comment on attachment 329031 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=329031&action=review > Source/WebCore/dom/Document.cpp:7630 > + m_serviceWorkerConnection->unregisterServiceWorkerClient({ m_serviceWorkerConnection->serverConnectionIdentifier(), identifier() }); I wonder whether we should not have made SWClientConnection only take DocumentIdentifier and do the translation to ServiceWorkerClientIdentifier on its own. Maybe this is too late for that. If not we could stick with passing a DocumentIdentifier to unregisterServieWorkerClient. > Source/WebCore/workers/service/ServiceWorkerClientData.cpp:65 > + RELEASE_ASSERT(isDocument); // We do not support dedicated workers as clients yet. Isn't the downcast<Document> doing this release assert already? > Source/WebCore/workers/service/context/ServiceWorkerThread.cpp:121 > + auto sourceClient = ServiceWorkerClient::getOrCreate(serviceWorkerGlobalScope, WTFMove(WTF::get<ServiceWorkerClientData>(sourceData))); Maybe use RefPtr<ServiceWorkerClient> here instead of auto so that there is not the need for it below for source =...? > Source/WebKit/StorageProcess/ServiceWorker/WebSWServerConnection.h:93 > + void unregisterServiceWorkerClient(const WebCore::ServiceWorkerClientIdentifier&); Sometimes we are using const ServiceWorkerClientIdentifier&, sometimes ServiceWorkerClientIdentifier directly.
Chris Dumez
Comment 4 2017-12-11 15:02:20 PST
Comment on attachment 329031 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=329031&action=review >> Source/WebCore/workers/service/ServiceWorkerClientData.cpp:65 >> + RELEASE_ASSERT(isDocument); // We do not support dedicated workers as clients yet. > > Isn't the downcast<Document> doing this release assert already? Nah, only a ASSERT_WITH_SECURITY_IMPLICATION() (i.e. debug only)
Chris Dumez
Comment 5 2017-12-11 15:08:45 PST
Chris Dumez
Comment 6 2017-12-11 15:24:57 PST
Comment on attachment 329042 [details] Patch Clearing flags on attachment: 329042 Committed r225760: <https://trac.webkit.org/changeset/225760>
Chris Dumez
Comment 7 2017-12-11 15:24:58 PST
All reviewed patches have been landed. Closing bug.
Radar WebKit Bug Importer
Comment 8 2017-12-11 15:25:25 PST
Note You need to log in before you can comment on or make changes to this bug.