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

Side by Side Diff: Source/modules/serviceworkers/WaitUntilObserver.cpp

Issue 1156703003: ServiceWorker: Introduce ExtendableMessageEvent to replace MessageEvent (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: update Created 5 years, 5 months 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "config.h" 5 #include "config.h"
6 #include "modules/serviceworkers/WaitUntilObserver.h" 6 #include "modules/serviceworkers/WaitUntilObserver.h"
7 7
8 #include "bindings/core/v8/ScriptFunction.h" 8 #include "bindings/core/v8/ScriptFunction.h"
9 #include "bindings/core/v8/ScriptPromise.h" 9 #include "bindings/core/v8/ScriptPromise.h"
10 #include "bindings/core/v8/ScriptValue.h" 10 #include "bindings/core/v8/ScriptValue.h"
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after
163 163
164 ServiceWorkerGlobalScopeClient* client = ServiceWorkerGlobalScopeClient::fro m(executionContext()); 164 ServiceWorkerGlobalScopeClient* client = ServiceWorkerGlobalScopeClient::fro m(executionContext());
165 WebServiceWorkerEventResult result = m_hasError ? WebServiceWorkerEventResul tRejected : WebServiceWorkerEventResultCompleted; 165 WebServiceWorkerEventResult result = m_hasError ? WebServiceWorkerEventResul tRejected : WebServiceWorkerEventResultCompleted;
166 switch (m_type) { 166 switch (m_type) {
167 case Activate: 167 case Activate:
168 client->didHandleActivateEvent(m_eventID, result); 168 client->didHandleActivateEvent(m_eventID, result);
169 break; 169 break;
170 case Install: 170 case Install:
171 client->didHandleInstallEvent(m_eventID, result); 171 client->didHandleInstallEvent(m_eventID, result);
172 break; 172 break;
173 case Message:
174 client->didHandleMessageEvent(m_eventID, result);
175 break;
173 case NotificationClick: 176 case NotificationClick:
174 client->didHandleNotificationClickEvent(m_eventID, result); 177 client->didHandleNotificationClickEvent(m_eventID, result);
175 m_consumeWindowInteractionTimer.stop(); 178 m_consumeWindowInteractionTimer.stop();
176 consumeWindowInteraction(nullptr); 179 consumeWindowInteraction(nullptr);
177 break; 180 break;
178 case Push: 181 case Push:
179 client->didHandlePushEvent(m_eventID, result); 182 client->didHandlePushEvent(m_eventID, result);
180 break; 183 break;
181 case Sync: 184 case Sync:
182 client->didHandleSyncEvent(m_eventID, result); 185 client->didHandleSyncEvent(m_eventID, result);
183 break; 186 break;
184 } 187 }
185 setContext(nullptr); 188 setContext(nullptr);
186 } 189 }
187 190
188 void WaitUntilObserver::consumeWindowInteraction(Timer<WaitUntilObserver>*) 191 void WaitUntilObserver::consumeWindowInteraction(Timer<WaitUntilObserver>*)
189 { 192 {
190 if (!executionContext()) 193 if (!executionContext())
191 return; 194 return;
192 executionContext()->consumeWindowInteraction(); 195 executionContext()->consumeWindowInteraction();
193 } 196 }
194 197
195 DEFINE_TRACE(WaitUntilObserver) 198 DEFINE_TRACE(WaitUntilObserver)
196 { 199 {
197 ContextLifecycleObserver::trace(visitor); 200 ContextLifecycleObserver::trace(visitor);
198 } 201 }
199 202
200 } // namespace blink 203 } // namespace blink
OLDNEW
« no previous file with comments | « Source/modules/serviceworkers/WaitUntilObserver.h ('k') | Source/web/ServiceWorkerGlobalScopeClientImpl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698