ASSERTION FAILED: !m_processes[i] || *m_processes[i] == process in MessagePortChannel...
authorcdumez@apple.com <cdumez@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 16 Feb 2018 19:05:07 +0000 (19:05 +0000)
committercdumez@apple.com <cdumez@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 16 Feb 2018 19:05:07 +0000 (19:05 +0000)
commit1b8857150a7ad98bdf24033b6874b708542f1a92
treee3300ec5ba90b90bf9c2979827d1b89303b095c2
parent7353b6344f47206b5b0f3468fa1c338b4f18b49a
ASSERTION FAILED: !m_processes[i] || *m_processes[i] == process in MessagePortChannel::entanglePortWithProcess()
https://bugs.webkit.org/show_bug.cgi?id=182054
<rdar://problem/36871207>

Reviewed by Brady Eidson.

Pipe postMessage messages to and from service workers via the UIProcess instead of going
directly to the StorageProcess. This is temporarily needed to avoid races due to the
MessagePort registry currently living in the UIProcess and postMessage messages potentially
sending MessagePort objects.

This change is covered by tests on the bots that currently flakily crash in debug.

* StorageProcess/ServiceWorker/WebSWServerConnection.h:
* StorageProcess/StorageProcess.cpp:
(WebKit::StorageProcess::postMessageToServiceWorker):
* StorageProcess/StorageProcess.h:
* StorageProcess/StorageProcess.messages.in:
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::postMessageToServiceWorkerClient):
(WebKit::WebProcessPool::postMessageToServiceWorker):
* UIProcess/WebProcessPool.h:
* UIProcess/WebProcessPool.messages.in:
* WebProcess/Storage/WebSWClientConnection.cpp:
(WebKit::WebSWClientConnection::postMessageToServiceWorker):
* WebProcess/Storage/WebSWContextManagerConnection.cpp:
(WebKit::WebSWContextManagerConnection::postMessageToServiceWorkerClient):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@228564 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebKit/ChangeLog
Source/WebKit/StorageProcess/ServiceWorker/WebSWServerConnection.h
Source/WebKit/StorageProcess/StorageProcess.cpp
Source/WebKit/StorageProcess/StorageProcess.h
Source/WebKit/StorageProcess/StorageProcess.messages.in
Source/WebKit/UIProcess/WebProcessPool.cpp
Source/WebKit/UIProcess/WebProcessPool.h
Source/WebKit/UIProcess/WebProcessPool.messages.in
Source/WebKit/WebProcess/Storage/WebSWClientConnection.cpp
Source/WebKit/WebProcess/Storage/WebSWContextManagerConnection.cpp