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

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

Issue 2034663002: ServiceWorker: Keep the worker alive until FetchEvent.waitUntil settles (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 4 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 "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 145 matching lines...) Expand 10 before | Expand all | Expand 10 after
156 ASSERT(m_pendingActivity > 0); 156 ASSERT(m_pendingActivity > 0);
157 if (!getExecutionContext() || (!m_hasError && --m_pendingActivity)) 157 if (!getExecutionContext() || (!m_hasError && --m_pendingActivity))
158 return; 158 return;
159 159
160 ServiceWorkerGlobalScopeClient* client = ServiceWorkerGlobalScopeClient::fro m(getExecutionContext()); 160 ServiceWorkerGlobalScopeClient* client = ServiceWorkerGlobalScopeClient::fro m(getExecutionContext());
161 WebServiceWorkerEventResult result = m_hasError ? WebServiceWorkerEventResul tRejected : WebServiceWorkerEventResultCompleted; 161 WebServiceWorkerEventResult result = m_hasError ? WebServiceWorkerEventResul tRejected : WebServiceWorkerEventResultCompleted;
162 switch (m_type) { 162 switch (m_type) {
163 case Activate: 163 case Activate:
164 client->didHandleActivateEvent(m_eventID, result); 164 client->didHandleActivateEvent(m_eventID, result);
165 break; 165 break;
166 case Fetch:
167 client->didHandleFetchEvent(m_eventID, result);
168 break;
166 case Install: 169 case Install:
167 client->didHandleInstallEvent(m_eventID, result); 170 client->didHandleInstallEvent(m_eventID, result);
168 break; 171 break;
169 case Message: 172 case Message:
170 client->didHandleExtendableMessageEvent(m_eventID, result); 173 client->didHandleExtendableMessageEvent(m_eventID, result);
171 break; 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);
(...skipping 17 matching lines...) Expand all
193 return; 196 return;
194 getExecutionContext()->consumeWindowInteraction(); 197 getExecutionContext()->consumeWindowInteraction();
195 } 198 }
196 199
197 DEFINE_TRACE(WaitUntilObserver) 200 DEFINE_TRACE(WaitUntilObserver)
198 { 201 {
199 ContextLifecycleObserver::trace(visitor); 202 ContextLifecycleObserver::trace(visitor);
200 } 203 }
201 204
202 } // namespace blink 205 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698