Title: [247923] trunk
Revision
247923
Author
[email protected]
Date
2019-07-29 14:43:42 -0700 (Mon, 29 Jul 2019)

Log Message

REGRESSION: WebSockets no longer work in Service Workers
https://bugs.webkit.org/show_bug.cgi?id=199906
<rdar://problem/53516732>

Reviewed by Geoffrey Garen.

Source/WebKit:

Use WebSocketProvider so that network calls are done in the network process.

* WebProcess/Storage/WebSWContextManagerConnection.cpp:
(WebKit::WebSWContextManagerConnection::installServiceWorker):

LayoutTests:

Fix test and make sure messages are exchanged for the test to succeed.

* http/tests/workers/service/resources/serviceworker-websocket-worker.js:
(async.doTest):

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (247922 => 247923)


--- trunk/LayoutTests/ChangeLog	2019-07-29 21:32:16 UTC (rev 247922)
+++ trunk/LayoutTests/ChangeLog	2019-07-29 21:43:42 UTC (rev 247923)
@@ -1,3 +1,16 @@
+2019-07-29  Youenn Fablet  <[email protected]>
+
+        REGRESSION: WebSockets no longer work in Service Workers
+        https://bugs.webkit.org/show_bug.cgi?id=199906
+        <rdar://problem/53516732>
+
+        Reviewed by Geoffrey Garen.
+
+        Fix test and make sure messages are exchanged for the test to succeed.
+
+        * http/tests/workers/service/resources/serviceworker-websocket-worker.js:
+        (async.doTest):
+
 2019-07-29  Ryan Haddad  <[email protected]>
 
         Unreviewed test gardening, update expectations for rdar://problem/48616298.

Modified: trunk/LayoutTests/http/tests/workers/service/resources/serviceworker-websocket-worker.js (247922 => 247923)


--- trunk/LayoutTests/http/tests/workers/service/resources/serviceworker-websocket-worker.js	2019-07-29 21:32:16 UTC (rev 247922)
+++ trunk/LayoutTests/http/tests/workers/service/resources/serviceworker-websocket-worker.js	2019-07-29 21:43:42 UTC (rev 247923)
@@ -4,7 +4,6 @@
         event.source.postMessage("FAIL: received unexpected message from client");
         return;
     }
-            event.source.postMessage("PASS");
 
     try {
         var webSocket = new WebSocket('ws://localhost:8880/websocket/tests/hybi/workers/resources/echo');
@@ -13,9 +12,13 @@
             event.source.postMessage("FAIL: websocket had an error: " + e);
         };
 
-        webSocket._onopen_ = () => {
+        webSocket._onmessage_ = (e) => {
             event.source.postMessage("PASS");
         };
+
+        webSocket._onopen_ = () => {
+            webSocket.send("PASS?");
+        };
     } catch (e) {
         event.source.postMessage("FAIL: exception was raised: " + e);
     }

Modified: trunk/Source/WebKit/ChangeLog (247922 => 247923)


--- trunk/Source/WebKit/ChangeLog	2019-07-29 21:32:16 UTC (rev 247922)
+++ trunk/Source/WebKit/ChangeLog	2019-07-29 21:43:42 UTC (rev 247923)
@@ -1,3 +1,16 @@
+2019-07-29  Youenn Fablet  <[email protected]>
+
+        REGRESSION: WebSockets no longer work in Service Workers
+        https://bugs.webkit.org/show_bug.cgi?id=199906
+        <rdar://problem/53516732>
+
+        Reviewed by Geoffrey Garen.
+
+        Use WebSocketProvider so that network calls are done in the network process.
+
+        * WebProcess/Storage/WebSWContextManagerConnection.cpp:
+        (WebKit::WebSWContextManagerConnection::installServiceWorker):
+
 2019-07-29  Zalan Bujtas  <[email protected]>
 
         [ContentChangeObserver] ChromeClient::observedContentChange() name is misleading

Modified: trunk/Source/WebKit/WebProcess/Storage/WebSWContextManagerConnection.cpp (247922 => 247923)


--- trunk/Source/WebKit/WebProcess/Storage/WebSWContextManagerConnection.cpp	2019-07-29 21:32:16 UTC (rev 247922)
+++ trunk/Source/WebKit/WebProcess/Storage/WebSWContextManagerConnection.cpp	2019-07-29 21:43:42 UTC (rev 247923)
@@ -145,6 +145,7 @@
 #if ENABLE(INDEXED_DATABASE)
     pageConfiguration.databaseProvider = WebDatabaseProvider::getOrCreate(m_pageGroupID);
 #endif
+    pageConfiguration.socketProvider = WebSocketProvider::create();
 
     auto effectiveUserAgent =  WTFMove(userAgent);
     if (effectiveUserAgent.isNull())
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to