Changeset 263622 in webkit
- Timestamp:
- Jun 27, 2020 9:13:56 AM (4 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r263617 r263622 1 2020-06-27 Youenn Fablet <youenn@apple.com> 2 3 Protect SWServer::claim from a registration without active worker 4 https://bugs.webkit.org/show_bug.cgi?id=213597 5 6 Reviewed by Chris Dumez. 7 8 SWServerWorker might be active while being terminated. 9 If terminated as part of SWServerRegistration::clear, the registration no longer has a service worker. 10 SWServer::claim should therefore check for registration active worker. 11 This is difficult to test as one needs to claim at the time the service worker is being terminated but not yet terminated. 12 13 * workers/service/server/SWServer.cpp: 14 (WebCore::SWServer::claim): 15 1 16 2020-06-27 Sam Weinig <weinig@apple.com> 2 17 -
trunk/Source/WebCore/workers/service/server/SWServer.cpp
r263521 r263622 582 582 Optional<ExceptionData> SWServer::claim(SWServerWorker& worker) 583 583 { 584 if (!worker.isActive()) 584 auto* registration = worker.registration(); 585 if (!registration || &worker != registration->activeWorker()) 585 586 return ExceptionData { InvalidStateError, "Service worker is not active"_s }; 586 587 587 588 auto& origin = worker.origin(); 588 589 forEachClientForOrigin(origin, [&](auto& clientData) { 589 auto* registration = this->doRegistrationMatching(origin.topOrigin, clientData.url); 590 if (!(registration && registration->key() == worker.registrationKey())) 590 if (doRegistrationMatching(origin.topOrigin, clientData.url) != registration) 591 591 return; 592 592
Note: See TracChangeset
for help on using the changeset viewer.