Changeset 228963 in webkit
- Timestamp:
- Feb 23, 2018 1:40:30 PM (6 years ago)
- Location:
- branches/safari-605-branch/Source
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/safari-605-branch/Source/WebCore/ChangeLog
r228961 r228963 1 2018-02-23 Jason Marcell <jmarcell@apple.com> 2 3 Apply patch. rdar://problem/37836719 4 5 2018-02-23 Chris Dumez <cdumez@apple.com> 6 7 Add release asserts for service worker fetch and postMessage events 8 https://bugs.webkit.org/show_bug.cgi?id=183025 9 <rdar://problem/37765052> 10 11 Reviewed by Chris Dumez. 12 13 Moving from release assert to early exit with release logging. 14 15 * workers/service/context/ServiceWorkerThread.cpp: 16 (WebCore::ServiceWorkerThread::postMessageToServiceWorker): 17 * workers/service/context/ServiceWorkerThreadProxy.h: 18 1 19 2018-02-23 Jason Marcell <jmarcell@apple.com> 2 20 -
branches/safari-605-branch/Source/WebCore/workers/service/context/ServiceWorkerThread.cpp
r228961 r228963 34 34 #include "ExtendableMessageEvent.h" 35 35 #include "JSDOMPromise.h" 36 #include "Logging.h" 36 37 #include "NetworkStateNotifier.h" 37 38 #include "SecurityOrigin.h" … … 121 122 RefPtr<ServiceWorkerClient> sourceClient = ServiceWorkerClient::getOrCreate(serviceWorkerGlobalScope, WTFMove(WTF::get<ServiceWorkerClientData>(sourceData))); 122 123 123 RELEASE_ASSERT(!sourceClient->url().protocolIsInHTTPFamily() || !serviceWorkerGlobalScope.url().protocolIsInHTTPFamily() || protocolHostAndPortAreEqual(serviceWorkerGlobalScope.url(), sourceClient->url())); 124 if (sourceClient->url().protocolIsInHTTPFamily() && serviceWorkerGlobalScope.url().protocolIsInHTTPFamily() && !protocolHostAndPortAreEqual(serviceWorkerGlobalScope.url(), sourceClient->url())) { 125 RELEASE_LOG_ERROR_IF(!context.sessionID().isEphemeral(), ServiceWorker, "ServiceWorkerThread::postMessageToServiceWorker - Received message from invalid service worker client due to origin - context is %p\n", &context); 126 ASSERT_NOT_REACHED(); 127 return; 128 } 124 129 125 130 sourceOrigin = SecurityOrigin::create(sourceClient->url()); … … 128 133 RefPtr<ServiceWorker> sourceWorker = ServiceWorker::getOrCreate(serviceWorkerGlobalScope, WTFMove(WTF::get<ServiceWorkerData>(sourceData))); 129 134 130 RELEASE_ASSERT(!sourceWorker->scriptURL().protocolIsInHTTPFamily() || !serviceWorkerGlobalScope.url().protocolIsInHTTPFamily() || protocolHostAndPortAreEqual(serviceWorkerGlobalScope.url(), sourceWorker->scriptURL())); 135 if (sourceWorker->scriptURL().protocolIsInHTTPFamily() && serviceWorkerGlobalScope.url().protocolIsInHTTPFamily() && !protocolHostAndPortAreEqual(serviceWorkerGlobalScope.url(), sourceWorker->scriptURL())) { 136 RELEASE_LOG_ERROR_IF(!context.sessionID().isEphemeral(), ServiceWorker, "ServiceWorkerThread::postMessageToServiceWorker - Received message from invalid service worker due to origin - context is %p\n", &context); 137 ASSERT_NOT_REACHED(); 138 return; 139 } 131 140 132 141 sourceOrigin = SecurityOrigin::create(sourceWorker->scriptURL()); -
branches/safari-605-branch/Source/WebCore/workers/service/context/ServiceWorkerThreadProxy.h
r228961 r228963 67 67 68 68 const URL& scriptURL() const { return m_document->url(); } 69 PAL::SessionID sessionID() const { return m_sessionID; } 69 70 70 71 // Public only for testing purposes. -
branches/safari-605-branch/Source/WebKit/ChangeLog
r228962 r228963 1 2018-02-23 Jason Marcell <jmarcell@apple.com> 2 3 Apply patch. rdar://problem/37836719 4 5 2018-02-23 Chris Dumez <cdumez@apple.com> 6 7 Add release asserts for service worker fetch and postMessage events 8 https://bugs.webkit.org/show_bug.cgi?id=183025 9 <rdar://problem/37765052> 10 11 Reviewed by Chris Dumez. 12 13 Moving from release assert to early exit with release logging. 14 15 * WebProcess/Storage/WebSWContextManagerConnection.cpp: 16 (WebKit::WebSWContextManagerConnection::startFetch): 17 1 18 2018-02-23 Jason Marcell <jmarcell@apple.com> 2 19 -
branches/safari-605-branch/Source/WebKit/WebProcess/Storage/WebSWContextManagerConnection.cpp
r228962 r228963 200 200 } 201 201 202 RELEASE_ASSERT(isValidFetch(request, options, serviceWorkerThreadProxy->scriptURL(), referrer)); 202 if (!isValidFetch(request, options, serviceWorkerThreadProxy->scriptURL(), referrer)) { 203 RELEASE_LOG_ERROR_IF(!serviceWorkerThreadProxy->sessionID().isEphemeral(), ServiceWorker, "%p - WebSWContextManagerConnection::startFetch - Service Worker received an invalid fetch due to origin", this); 204 m_connectionToStorageProcess->send(Messages::StorageProcess::DidNotHandleFetch(serverConnectionIdentifier, fetchIdentifier), 0); 205 ASSERT_NOT_REACHED(); 206 return; 207 } 203 208 204 209 auto client = WebServiceWorkerFetchTaskClient::create(m_connectionToStorageProcess.copyRef(), serviceWorkerIdentifier, serverConnectionIdentifier, fetchIdentifier);
Note: See TracChangeset
for help on using the changeset viewer.