Title: [245200] trunk
- Revision
- 245200
- Author
- [email protected]
- Date
- 2019-05-10 16:33:38 -0700 (Fri, 10 May 2019)
Log Message
A service worker instance should be terminated when its SWServer is destroyed
https://bugs.webkit.org/show_bug.cgi?id=197801
<rdar://problem/50587270>
Reviewed by Chris Dumez.
Source/WebCore:
On session destruction, the SWServer is destroyed.
At that time, it should terminate all its running service workers.
Covered by updated API test.
* workers/service/server/SWServer.cpp:
(WebCore::SWServer::~SWServer):
Tools:
* TestWebKitAPI/Tests/WebKitCocoa/ServiceWorkerBasic.mm:
Modified Paths
Diff
Modified: trunk/Source/WebCore/ChangeLog (245199 => 245200)
--- trunk/Source/WebCore/ChangeLog 2019-05-10 23:29:56 UTC (rev 245199)
+++ trunk/Source/WebCore/ChangeLog 2019-05-10 23:33:38 UTC (rev 245200)
@@ -1,3 +1,18 @@
+2019-05-10 Youenn Fablet <[email protected]>
+
+ A service worker instance should be terminated when its SWServer is destroyed
+ https://bugs.webkit.org/show_bug.cgi?id=197801
+ <rdar://problem/50587270>
+
+ Reviewed by Chris Dumez.
+
+ On session destruction, the SWServer is destroyed.
+ At that time, it should terminate all its running service workers.
+ Covered by updated API test.
+
+ * workers/service/server/SWServer.cpp:
+ (WebCore::SWServer::~SWServer):
+
2019-05-10 Eric Carlson <[email protected]>
[iOS] HTMLMediaElement sometimes doesn't send 'webkitplaybacktargetavailabilitychanged' event
Modified: trunk/Source/WebCore/workers/service/server/SWServer.cpp (245199 => 245200)
--- trunk/Source/WebCore/workers/service/server/SWServer.cpp 2019-05-10 23:29:56 UTC (rev 245199)
+++ trunk/Source/WebCore/workers/service/server/SWServer.cpp 2019-05-10 23:33:38 UTC (rev 245200)
@@ -69,6 +69,14 @@
auto connections = WTFMove(m_connections);
connections.clear();
+ Vector<SWServerWorker*> runningWorkers;
+ for (auto& worker : m_runningOrTerminatingWorkers.values()) {
+ if (worker->isRunning())
+ runningWorkers.append(worker.ptr());
+ }
+ for (auto& runningWorker : runningWorkers)
+ terminateWorker(*runningWorker);
+
allServers().remove(this);
}
Modified: trunk/Tools/ChangeLog (245199 => 245200)
--- trunk/Tools/ChangeLog 2019-05-10 23:29:56 UTC (rev 245199)
+++ trunk/Tools/ChangeLog 2019-05-10 23:33:38 UTC (rev 245200)
@@ -1,3 +1,13 @@
+2019-05-10 Youenn Fablet <[email protected]>
+
+ A service worker instance should be terminated when its SWServer is destroyed
+ https://bugs.webkit.org/show_bug.cgi?id=197801
+ <rdar://problem/50587270>
+
+ Reviewed by Chris Dumez.
+
+ * TestWebKitAPI/Tests/WebKitCocoa/ServiceWorkerBasic.mm:
+
2019-05-10 Chris Dumez <[email protected]>
Do not wait until requestPermission() is called to fire deviceorientation events if permission was already granted
Modified: trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/ServiceWorkerBasic.mm (245199 => 245200)
--- trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/ServiceWorkerBasic.mm 2019-05-10 23:29:56 UTC (rev 245199)
+++ trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/ServiceWorkerBasic.mm 2019-05-10 23:33:38 UTC (rev 245200)
@@ -32,6 +32,7 @@
#import <WebKit/WKURLSchemeHandler.h>
#import <WebKit/WKURLSchemeTaskPrivate.h>
#import <WebKit/WKWebViewConfigurationPrivate.h>
+#import <WebKit/WKWebViewPrivate.h>
#import <WebKit/WKWebsiteDataStorePrivate.h>
#import <WebKit/WKWebsiteDataStoreRef.h>
#import <WebKit/WebKit.h>
@@ -1502,6 +1503,7 @@
TestWebKitAPI::Util::run(&done);
done = false;
+ [webView _close];
webView = nullptr;
EXPECT_TRUE([[NSFileManager defaultManager] fileExistsAtPath:serviceWorkersPath.path]);
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes