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

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

Issue 1632113004: ServiceWorker: Add initial implementation of ExtendableMessageEvent behind a flag (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 10 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 "modules/serviceworkers/WaitUntilObserver.h" 5 #include "modules/serviceworkers/WaitUntilObserver.h"
6 6
7 #include "bindings/core/v8/ScriptFunction.h" 7 #include "bindings/core/v8/ScriptFunction.h"
8 #include "bindings/core/v8/ScriptPromise.h" 8 #include "bindings/core/v8/ScriptPromise.h"
9 #include "bindings/core/v8/ScriptValue.h" 9 #include "bindings/core/v8/ScriptValue.h"
10 #include "bindings/core/v8/V8Binding.h" 10 #include "bindings/core/v8/V8Binding.h"
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after
162 162
163 ServiceWorkerGlobalScopeClient* client = ServiceWorkerGlobalScopeClient::fro m(executionContext()); 163 ServiceWorkerGlobalScopeClient* client = ServiceWorkerGlobalScopeClient::fro m(executionContext());
164 WebServiceWorkerEventResult result = m_hasError ? WebServiceWorkerEventResul tRejected : WebServiceWorkerEventResultCompleted; 164 WebServiceWorkerEventResult result = m_hasError ? WebServiceWorkerEventResul tRejected : WebServiceWorkerEventResultCompleted;
165 switch (m_type) { 165 switch (m_type) {
166 case Activate: 166 case Activate:
167 client->didHandleActivateEvent(m_eventID, result); 167 client->didHandleActivateEvent(m_eventID, result);
168 break; 168 break;
169 case Install: 169 case Install:
170 client->didHandleInstallEvent(m_eventID, result); 170 client->didHandleInstallEvent(m_eventID, result);
171 break; 171 break;
172 case Message:
173 client->didHandleExtendableMessageEvent(m_eventID, result);
174 break;
172 case NotificationClick: 175 case NotificationClick:
173 client->didHandleNotificationClickEvent(m_eventID, result); 176 client->didHandleNotificationClickEvent(m_eventID, result);
174 m_consumeWindowInteractionTimer.stop(); 177 m_consumeWindowInteractionTimer.stop();
175 consumeWindowInteraction(nullptr); 178 consumeWindowInteraction(nullptr);
176 break; 179 break;
177 case Push: 180 case Push:
178 client->didHandlePushEvent(m_eventID, result); 181 client->didHandlePushEvent(m_eventID, result);
179 break; 182 break;
180 case Sync: 183 case Sync:
181 client->didHandleSyncEvent(m_eventID, result); 184 client->didHandleSyncEvent(m_eventID, result);
182 break; 185 break;
183 } 186 }
184 setContext(nullptr); 187 setContext(nullptr);
185 } 188 }
186 189
187 void WaitUntilObserver::consumeWindowInteraction(Timer<WaitUntilObserver>*) 190 void WaitUntilObserver::consumeWindowInteraction(Timer<WaitUntilObserver>*)
188 { 191 {
189 if (!executionContext()) 192 if (!executionContext())
190 return; 193 return;
191 executionContext()->consumeWindowInteraction(); 194 executionContext()->consumeWindowInteraction();
192 } 195 }
193 196
194 DEFINE_TRACE(WaitUntilObserver) 197 DEFINE_TRACE(WaitUntilObserver)
195 { 198 {
196 ContextLifecycleObserver::trace(visitor); 199 ContextLifecycleObserver::trace(visitor);
197 } 200 }
198 201
199 } // namespace blink 202 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698