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

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

Issue 2867023002: [ServiceWorker] waitUntil() should wait until all promises got resolved/rejected. (Closed)
Patch Set: Created 3 years, 7 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 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
57 void DecrementPendingActivity(); 57 void DecrementPendingActivity();
58 58
59 DECLARE_VIRTUAL_TRACE(); 59 DECLARE_VIRTUAL_TRACE();
60 60
61 private: 61 private:
62 friend class InternalsServiceWorker; 62 friend class InternalsServiceWorker;
63 class ThenFunction; 63 class ThenFunction;
64 64
65 WaitUntilObserver(ExecutionContext*, EventType, int event_id); 65 WaitUntilObserver(ExecutionContext*, EventType, int event_id);
66 66
67 void ReportError(const ScriptValue&); 67 void ReportPromiseRejected(const ScriptValue&);
68 68
69 void ConsumeWindowInteraction(TimerBase*); 69 void ConsumeWindowInteraction(TimerBase*);
70 70
71 Member<ExecutionContext> execution_context_; 71 Member<ExecutionContext> execution_context_;
72 EventType type_; 72 EventType type_;
73 int event_id_; 73 int event_id_;
74 int pending_activity_ = 0; 74 int pending_activity_ = 0;
75 bool has_error_ = false; 75 bool has_error_ = false;
76 bool has_rejected_promise_ = false;
76 bool event_dispatched_ = false; 77 bool event_dispatched_ = false;
77 double event_dispatch_time_ = 0; 78 double event_dispatch_time_ = 0;
78 TaskRunnerTimer<WaitUntilObserver> consume_window_interaction_timer_; 79 TaskRunnerTimer<WaitUntilObserver> consume_window_interaction_timer_;
79 }; 80 };
80 81
81 } // namespace blink 82 } // namespace blink
82 83
83 #endif // WaitUntilObserver_h 84 #endif // WaitUntilObserver_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698