Changeset 228564 in webkit
- Timestamp:
- Feb 16, 2018 11:05:07 AM (6 years ago)
- Location:
- trunk/Source/WebKit
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit/ChangeLog
r228557 r228564 1 2018-02-16 Chris Dumez <cdumez@apple.com> 2 3 ASSERTION FAILED: !m_processes[i] || *m_processes[i] == process in MessagePortChannel::entanglePortWithProcess() 4 https://bugs.webkit.org/show_bug.cgi?id=182054 5 <rdar://problem/36871207> 6 7 Reviewed by Brady Eidson. 8 9 Pipe postMessage messages to and from service workers via the UIProcess instead of going 10 directly to the StorageProcess. This is temporarily needed to avoid races due to the 11 MessagePort registry currently living in the UIProcess and postMessage messages potentially 12 sending MessagePort objects. 13 14 This change is covered by tests on the bots that currently flakily crash in debug. 15 16 * StorageProcess/ServiceWorker/WebSWServerConnection.h: 17 * StorageProcess/StorageProcess.cpp: 18 (WebKit::StorageProcess::postMessageToServiceWorker): 19 * StorageProcess/StorageProcess.h: 20 * StorageProcess/StorageProcess.messages.in: 21 * UIProcess/WebProcessPool.cpp: 22 (WebKit::WebProcessPool::postMessageToServiceWorkerClient): 23 (WebKit::WebProcessPool::postMessageToServiceWorker): 24 * UIProcess/WebProcessPool.h: 25 * UIProcess/WebProcessPool.messages.in: 26 * WebProcess/Storage/WebSWClientConnection.cpp: 27 (WebKit::WebSWClientConnection::postMessageToServiceWorker): 28 * WebProcess/Storage/WebSWContextManagerConnection.cpp: 29 (WebKit::WebSWContextManagerConnection::postMessageToServiceWorkerClient): 30 1 31 2018-02-16 Wenson Hsieh <wenson_hsieh@apple.com> 2 32 -
trunk/Source/WebKit/StorageProcess/ServiceWorker/WebSWServerConnection.h
r227989 r228564 70 70 71 71 void postMessageToServiceWorkerClient(WebCore::DocumentIdentifier destinationContextIdentifier, WebCore::MessageWithMessagePorts&&, WebCore::ServiceWorkerIdentifier sourceServiceWorkerIdentifier, const String& sourceOrigin); 72 void postMessageToServiceWorker(WebCore::ServiceWorkerIdentifier destination, WebCore::MessageWithMessagePorts&&, const WebCore::ServiceWorkerOrClientIdentifier& source); 72 73 73 74 private: … … 88 89 89 90 void startFetch(uint64_t fetchIdentifier, WebCore::ServiceWorkerRegistrationIdentifier, WebCore::ResourceRequest&&, WebCore::FetchOptions&&, IPC::FormDataReference&&, String&& referrer); 90 91 void postMessageToServiceWorker(WebCore::ServiceWorkerIdentifier destination, WebCore::MessageWithMessagePorts&&, const WebCore::ServiceWorkerOrClientIdentifier& source);92 91 93 92 void matchRegistration(uint64_t registrationMatchRequestIdentifier, const WebCore::SecurityOriginData& topOrigin, const WebCore::URL& clientURL); -
trunk/Source/WebKit/StorageProcess/StorageProcess.cpp
r227789 r228564 485 485 } 486 486 487 void StorageProcess::postMessageToServiceWorker(WebCore::ServiceWorkerIdentifier destination, WebCore::MessageWithMessagePorts&& message, const WebCore::ServiceWorkerOrClientIdentifier& source, SWServerConnectionIdentifier connectionIdentifier) 488 { 489 if (auto* connection = m_swServerConnections.get(connectionIdentifier)) 490 connection->postMessageToServiceWorker(destination, WTFMove(message), source); 491 } 492 487 493 void StorageProcess::registerSWServerConnection(WebSWServerConnection& connection) 488 494 { -
trunk/Source/WebKit/StorageProcess/StorageProcess.h
r228021 r228564 138 138 139 139 void postMessageToServiceWorkerClient(const WebCore::ServiceWorkerClientIdentifier& destinationIdentifier, WebCore::MessageWithMessagePorts&&, WebCore::ServiceWorkerIdentifier sourceIdentifier, const String& sourceOrigin); 140 void postMessageToServiceWorker(WebCore::ServiceWorkerIdentifier destination, WebCore::MessageWithMessagePorts&&, const WebCore::ServiceWorkerOrClientIdentifier& source, WebCore::SWServerConnectionIdentifier); 141 140 142 WebSWOriginStore& swOriginStoreForSession(PAL::SessionID); 141 143 bool needsServerToContextConnection() const; -
trunk/Source/WebKit/StorageProcess/StorageProcess.messages.in
r227425 r228564 44 44 DidFinishFetch(WebCore::SWServerConnectionIdentifier serverConnectionIdentifier, uint64_t fetchIdentifier) 45 45 PostMessageToServiceWorkerClient(struct WebCore::ServiceWorkerClientIdentifier destinationIdentifier, struct WebCore::MessageWithMessagePorts message, WebCore::ServiceWorkerIdentifier sourceIdentifier, String sourceOrigin) 46 47 PostMessageToServiceWorker(WebCore::ServiceWorkerIdentifier destination, struct WebCore::MessageWithMessagePorts message, WebCore::ServiceWorkerOrClientIdentifier source, WebCore::SWServerConnectionIdentifier connectionIdentifier) 46 48 #endif 47 49 } -
trunk/Source/WebKit/UIProcess/WebProcessPool.cpp
r228307 r228564 1843 1843 } 1844 1844 1845 #if ENABLE(SERVICE_WORKER) 1846 void WebProcessPool::postMessageToServiceWorkerClient(const ServiceWorkerClientIdentifier& destination, MessageWithMessagePorts&& message, ServiceWorkerIdentifier source, const String& sourceOrigin) 1847 { 1848 sendToStorageProcessRelaunchingIfNecessary(Messages::StorageProcess::PostMessageToServiceWorkerClient(destination, WTFMove(message), source, sourceOrigin)); 1849 } 1850 1851 void WebProcessPool::postMessageToServiceWorker(ServiceWorkerIdentifier destination, MessageWithMessagePorts&& message, const ServiceWorkerOrClientIdentifier& source, SWServerConnectionIdentifier connectionIdentifier) 1852 { 1853 sendToStorageProcessRelaunchingIfNecessary(Messages::StorageProcess::PostMessageToServiceWorker(destination, WTFMove(message), source, connectionIdentifier)); 1854 } 1855 #endif 1856 1845 1857 void WebProcessPool::reinstateNetworkProcessAssertionState(NetworkProcessProxy& newNetworkProcessProxy) 1846 1858 { -
trunk/Source/WebKit/UIProcess/WebProcessPool.h
r228230 r228564 426 426 #endif 427 427 428 #if ENABLE(SERVICE_WORKER) 429 void postMessageToServiceWorkerClient(const WebCore::ServiceWorkerClientIdentifier& destinationIdentifier, WebCore::MessageWithMessagePorts&&, WebCore::ServiceWorkerIdentifier sourceIdentifier, const String& sourceOrigin); 430 void postMessageToServiceWorker(WebCore::ServiceWorkerIdentifier destination, WebCore::MessageWithMessagePorts&&, const WebCore::ServiceWorkerOrClientIdentifier& source, WebCore::SWServerConnectionIdentifier); 431 #endif 432 428 433 static uint64_t registerProcessPoolCreationListener(Function<void(WebProcessPool&)>&&); 429 434 static void unregisterProcessPoolCreationListener(uint64_t identifier); -
trunk/Source/WebKit/UIProcess/WebProcessPool.messages.in
r220857 r228564 37 37 38 38 ReportWebContentCPUTime(Seconds cpuTime, uint64_t activityState) 39 40 #if ENABLE(SERVICE_WORKER) 41 PostMessageToServiceWorkerClient(struct WebCore::ServiceWorkerClientIdentifier destinationIdentifier, struct WebCore::MessageWithMessagePorts message, WebCore::ServiceWorkerIdentifier sourceIdentifier, String sourceOrigin) 42 PostMessageToServiceWorker(WebCore::ServiceWorkerIdentifier destination, struct WebCore::MessageWithMessagePorts message, WebCore::ServiceWorkerOrClientIdentifier source, WebCore::SWServerConnectionIdentifier connectionIdentifier) 43 #endif 39 44 } -
trunk/Source/WebKit/WebProcess/Storage/WebSWClientConnection.cpp
r227789 r228564 35 35 #include "StorageToWebProcessConnectionMessages.h" 36 36 #include "WebCoreArgumentCoders.h" 37 #include "WebProcess.h" 38 #include "WebProcessPoolMessages.h" 37 39 #include "WebSWOriginTable.h" 38 40 #include "WebSWServerConnectionMessages.h" … … 86 88 void WebSWClientConnection::postMessageToServiceWorker(ServiceWorkerIdentifier destinationIdentifier, MessageWithMessagePorts&& message, const ServiceWorkerOrClientIdentifier& sourceIdentifier) 87 89 { 88 send(Messages::WebSWServerConnection::PostMessageToServiceWorker(destinationIdentifier, WTFMove(message), sourceIdentifier) ); 90 // FIXME: Temporarily pipe the SW postMessage messages via the UIProcess since this is where the MessagePort registry lives 91 // and this avoids races. 92 WebProcess::singleton().send(Messages::WebProcessPool::PostMessageToServiceWorker(destinationIdentifier, WTFMove(message), sourceIdentifier, serverConnectionIdentifier()), 0); 89 93 } 90 94 -
trunk/Source/WebKit/WebProcess/Storage/WebSWContextManagerConnection.cpp
r228230 r228564 40 40 #include "WebPreferencesStore.h" 41 41 #include "WebProcess.h" 42 #include "WebProcessPoolMessages.h" 42 43 #include "WebSWServerToContextConnectionMessages.h" 43 44 #include "WebServiceWorkerFetchTaskClient.h" … … 220 221 void WebSWContextManagerConnection::postMessageToServiceWorkerClient(const ServiceWorkerClientIdentifier& destinationIdentifier, MessageWithMessagePorts&& message, ServiceWorkerIdentifier sourceIdentifier, const String& sourceOrigin) 221 222 { 222 m_connectionToStorageProcess->send(Messages::StorageProcess::PostMessageToServiceWorkerClient(destinationIdentifier, WTFMove(message), sourceIdentifier, sourceOrigin), 0); 223 // FIXME: Temporarily pipe the SW postMessage messages via the UIProcess since this is where the MessagePort registry lives 224 // and this avoids races. 225 WebProcess::singleton().send(Messages::WebProcessPool::PostMessageToServiceWorkerClient(destinationIdentifier, WTFMove(message), sourceIdentifier, sourceOrigin), 0); 223 226 } 224 227
Note: See TracChangeset
for help on using the changeset viewer.