Index: third_party/WebKit/Source/web/ServiceWorkerGlobalScopeProxy.cpp |
diff --git a/third_party/WebKit/Source/web/ServiceWorkerGlobalScopeProxy.cpp b/third_party/WebKit/Source/web/ServiceWorkerGlobalScopeProxy.cpp |
index ea9b057028b267d383a5113b4d4beeacf4ebd5bc..a3f55103c80fd50c879e71b6b82537caa545a4d8 100644 |
--- a/third_party/WebKit/Source/web/ServiceWorkerGlobalScopeProxy.cpp |
+++ b/third_party/WebKit/Source/web/ServiceWorkerGlobalScopeProxy.cpp |
@@ -157,8 +157,13 @@ void ServiceWorkerGlobalScopeProxy::dispatchPushEvent(int eventID, const WebStri |
{ |
ASSERT(m_workerGlobalScope); |
WaitUntilObserver* observer = WaitUntilObserver::create(m_workerGlobalScope, WaitUntilObserver::Push, eventID); |
- RefPtrWillBeRawPtr<Event> event(PushEvent::create(EventTypeNames::push, PushMessageData::create(data), observer)); |
- m_workerGlobalScope->dispatchExtendableEvent(event.release(), observer); |
+ NonThrowableExceptionState exceptionState; |
+ PushMessageData* messageData = PushMessageData::create(data, exceptionState); |
+ // Fail silently by dropping the event when the allocation of PushMessageData fails (out of memory), which results in an exception |
+ if (!exceptionState.hadException()) { |
+ RefPtrWillBeRawPtr<Event> event(PushEvent::create(EventTypeNames::push, messageData, observer)); |
+ m_workerGlobalScope->dispatchExtendableEvent(event.release(), observer); |
+ } |
} |
void ServiceWorkerGlobalScopeProxy::dispatchServicePortConnectEvent(WebServicePortConnectEventCallbacks* rawCallbacks, const WebURL& targetURL, const WebString& origin, WebServicePortID portID) |