Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(51)

Unified Diff: Source/web/ServiceWorkerGlobalScopeProxy.cpp

Issue 716203003: The "push" event should inherit from ExtendableEvent. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Remove PushEvent from global ctors Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/modules/serviceworkers/WaitUntilObserver.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/web/ServiceWorkerGlobalScopeProxy.cpp
diff --git a/Source/web/ServiceWorkerGlobalScopeProxy.cpp b/Source/web/ServiceWorkerGlobalScopeProxy.cpp
index 73f7f26bd18869216aaa78eeafd4da9cc2e500e3..75b1e0e5137d34764c5c570f1ec9ddf722a60088 100644
--- a/Source/web/ServiceWorkerGlobalScopeProxy.cpp
+++ b/Source/web/ServiceWorkerGlobalScopeProxy.cpp
@@ -140,11 +140,9 @@ void ServiceWorkerGlobalScopeProxy::dispatchNotificationErrorEvent(int eventID,
void ServiceWorkerGlobalScopeProxy::dispatchPushEvent(int eventID, const WebString& data)
{
ASSERT(m_workerGlobalScope);
- m_workerGlobalScope->dispatchEvent(PushEvent::create(EventTypeNames::push, data));
- // TODO(mvanouwerkerk): Instead of calling didHandlePushEvent here, it
- // should get called from WaitUntilObserver::decrementPendingActivity once
- // the push event is hooked up to event.waitUntil (crbug.com/430888).
- ServiceWorkerGlobalScopeClient::from(m_workerGlobalScope)->didHandlePushEvent(eventID, WebServiceWorkerEventResultCompleted);
+ WaitUntilObserver* observer = WaitUntilObserver::create(m_workerGlobalScope, WaitUntilObserver::Push, eventID);
+ RefPtrWillBeRawPtr<Event> event(PushEvent::create(EventTypeNames::push, data, observer));
+ m_workerGlobalScope->dispatchExtendableEvent(event.release(), observer);
}
void ServiceWorkerGlobalScopeProxy::dispatchSyncEvent(int eventID)
« no previous file with comments | « Source/modules/serviceworkers/WaitUntilObserver.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698