Layout Test http/tests/workers/service/postmessage-after-sw-process-crash.https.html...
authorcdumez@apple.com <cdumez@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 11 Dec 2017 22:49:10 +0000 (22:49 +0000)
committercdumez@apple.com <cdumez@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 11 Dec 2017 22:49:10 +0000 (22:49 +0000)
commit2cdf13ca147e374302607ed049d48b64200cee5b
tree78e8fc5d3f491f07680db1c93e57a1ea828fcdb6
parentaf35e2c4caa555b4fd0a78977feb79b07abf7d8a
Layout Test http/tests/workers/service/postmessage-after-sw-process-crash.https.html is flaky
https://bugs.webkit.org/show_bug.cgi?id=180659

Reviewed by Youenn Fablet.

Source/WebKit:

Fix flaky crash due to capturing an IPC::DataReference in a lambda, which would point to invalid
memory when the lambda is called asynchronously.

* StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
(WebKit::WebSWServerConnection::postMessageToServiceWorkerFromClient):
(WebKit::WebSWServerConnection::postMessageToServiceWorkerFromServiceWorker):

LayoutTests:

Rewrite test so that it is no longer flaky.

* http/tests/workers/service/postmessage-after-sw-process-crash.https-expected.txt:
* http/tests/workers/service/resources/postmessage-after-sw-process-crash-worker.js: Added.
* http/tests/workers/service/resources/postmessage-after-sw-process-crash.js:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@225758 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/http/tests/workers/service/postmessage-after-sw-process-crash.https-expected.txt
LayoutTests/http/tests/workers/service/resources/postmessage-after-sw-process-crash-worker.js [new file with mode: 0644]
LayoutTests/http/tests/workers/service/resources/postmessage-after-sw-process-crash.js
Source/WebKit/ChangeLog
Source/WebKit/StorageProcess/ServiceWorker/WebSWServerConnection.cpp