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

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

Issue 1148293011: BackgroundSync sync events need to be ExtendableEvents, blink side (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Remove unnecessary comment Created 5 years, 6 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 "core/dom/ContextLifecycleObserver.h" 8 #include "core/dom/ContextLifecycleObserver.h"
9 #include "modules/ModulesExport.h" 9 #include "modules/ModulesExport.h"
10 #include "modules/serviceworkers/ServiceWorkerGlobalScopeClient.h" 10 #include "modules/serviceworkers/ServiceWorkerGlobalScopeClient.h"
11 #include "platform/Timer.h" 11 #include "platform/Timer.h"
12 #include "wtf/Forward.h" 12 #include "wtf/Forward.h"
13 #include "wtf/RefCounted.h" 13 #include "wtf/RefCounted.h"
14 14
15 namespace blink { 15 namespace blink {
16 16
17 class ExceptionState; 17 class ExceptionState;
18 class ExecutionContext; 18 class ExecutionContext;
19 class ScriptState; 19 class ScriptState;
20 class ScriptValue; 20 class ScriptValue;
21 21
22 // Created for each ExtendableEvent instance. 22 // Created for each ExtendableEvent instance.
23 class MODULES_EXPORT WaitUntilObserver final : public GarbageCollectedFinalized< WaitUntilObserver>, public ContextLifecycleObserver { 23 class MODULES_EXPORT WaitUntilObserver final : public GarbageCollectedFinalized< WaitUntilObserver>, public ContextLifecycleObserver {
24 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(WaitUntilObserver); 24 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(WaitUntilObserver);
25 public: 25 public:
26 enum EventType { 26 enum EventType {
27 Activate, 27 Activate,
28 Install, 28 Install,
29 NotificationClick, 29 NotificationClick,
30 Push 30 Push,
31 Sync
31 }; 32 };
32 33
33 static WaitUntilObserver* create(ExecutionContext*, EventType, int eventID); 34 static WaitUntilObserver* create(ExecutionContext*, EventType, int eventID);
34 35
35 // Must be called before and after dispatching the event. 36 // Must be called before and after dispatching the event.
36 void willDispatchEvent(); 37 void willDispatchEvent();
37 void didDispatchEvent(bool errorOccurred); 38 void didDispatchEvent(bool errorOccurred);
38 39
39 // Observes the promise and delays calling the continuation until 40 // Observes the promise and delays calling the continuation until
40 // the given promise is resolved or rejected. 41 // the given promise is resolved or rejected.
(...skipping 18 matching lines...) Expand all
59 int m_eventID; 60 int m_eventID;
60 int m_pendingActivity; 61 int m_pendingActivity;
61 bool m_hasError; 62 bool m_hasError;
62 bool m_eventDispatched; 63 bool m_eventDispatched;
63 Timer<WaitUntilObserver> m_consumeWindowInteractionTimer; 64 Timer<WaitUntilObserver> m_consumeWindowInteractionTimer;
64 }; 65 };
65 66
66 } // namespace blink 67 } // namespace blink
67 68
68 #endif // WaitUntilObserver_h 69 #endif // WaitUntilObserver_h
OLDNEW
« no previous file with comments | « Source/modules/serviceworkers/ServiceWorkerGlobalScopeClient.h ('k') | Source/modules/serviceworkers/WaitUntilObserver.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698