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

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

Issue 2748213003: Service Worker event dispatcher for Background Fetch (Closed)
Patch Set: uma fix Created 3 years, 9 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 #ifndef WaitUntilObserver_h 5 #ifndef WaitUntilObserver_h
6 #define WaitUntilObserver_h 6 #define WaitUntilObserver_h
7 7
8 #include "modules/ModulesExport.h" 8 #include "modules/ModulesExport.h"
9 #include "modules/serviceworkers/ServiceWorkerGlobalScopeClient.h" 9 #include "modules/serviceworkers/ServiceWorkerGlobalScopeClient.h"
10 #include "platform/Timer.h" 10 #include "platform/Timer.h"
(...skipping 13 matching lines...) Expand all
24 public: 24 public:
25 enum EventType { 25 enum EventType {
26 Activate, 26 Activate,
27 Fetch, 27 Fetch,
28 Install, 28 Install,
29 Message, 29 Message,
30 NotificationClick, 30 NotificationClick,
31 NotificationClose, 31 NotificationClose,
32 PaymentRequest, 32 PaymentRequest,
33 Push, 33 Push,
34 Sync 34 Sync,
35 BackgroundFetchAbort,
36 BackgroundFetchClick
35 }; 37 };
36 38
37 static WaitUntilObserver* create(ExecutionContext*, EventType, int eventID); 39 static WaitUntilObserver* create(ExecutionContext*, EventType, int eventID);
38 40
39 // Must be called before and after dispatching the event. 41 // Must be called before and after dispatching the event.
40 void willDispatchEvent(); 42 void willDispatchEvent();
41 void didDispatchEvent(bool errorOccurred); 43 void didDispatchEvent(bool errorOccurred);
42 44
43 // Observes the promise and delays calling the continuation until 45 // Observes the promise and delays calling the continuation until
44 // the given promise is resolved or rejected. 46 // the given promise is resolved or rejected.
(...skipping 25 matching lines...) Expand all
70 int m_pendingActivity = 0; 72 int m_pendingActivity = 0;
71 bool m_hasError = false; 73 bool m_hasError = false;
72 bool m_eventDispatched = false; 74 bool m_eventDispatched = false;
73 double m_eventDispatchTime = 0; 75 double m_eventDispatchTime = 0;
74 TaskRunnerTimer<WaitUntilObserver> m_consumeWindowInteractionTimer; 76 TaskRunnerTimer<WaitUntilObserver> m_consumeWindowInteractionTimer;
75 }; 77 };
76 78
77 } // namespace blink 79 } // namespace blink
78 80
79 #endif // WaitUntilObserver_h 81 #endif // WaitUntilObserver_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698