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

Side by Side Diff: third_party/WebKit/Source/core/dom/ScriptedIdleTaskController.h

Issue 1133713008: [WIP] Migrate hasPendingActivity from ActiveDOMObject to ScriptWrappable. Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Review Comments Created 5 years, 2 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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 ScriptedIdleTaskController_h 5 #ifndef ScriptedIdleTaskController_h
6 #define ScriptedIdleTaskController_h 6 #define ScriptedIdleTaskController_h
7 7
8 #include "core/dom/ActiveDOMObject.h" 8 #include "core/dom/ActiveDOMObject.h"
9 #include "core/dom/IdleDeadline.h" 9 #include "core/dom/IdleDeadline.h"
10 #include "platform/Timer.h" 10 #include "platform/Timer.h"
(...skipping 21 matching lines...) Expand all
32 32
33 using CallbackId = int; 33 using CallbackId = int;
34 34
35 int registerCallback(IdleRequestCallback*, const IdleRequestOptions&); 35 int registerCallback(IdleRequestCallback*, const IdleRequestOptions&);
36 void cancelCallback(CallbackId); 36 void cancelCallback(CallbackId);
37 37
38 // ActiveDOMObject interface. 38 // ActiveDOMObject interface.
39 void stop() override; 39 void stop() override;
40 void suspend() override; 40 void suspend() override;
41 void resume() override; 41 void resume() override;
42 bool hasPendingActivity() const override; 42 bool hasPendingActivity() const;
43 43
44 void callbackFired(CallbackId, double deadlineSeconds, IdleDeadline::Callbac kType); 44 void callbackFired(CallbackId, double deadlineSeconds, IdleDeadline::Callbac kType);
45 45
46 private: 46 private:
47 explicit ScriptedIdleTaskController(ExecutionContext*); 47 explicit ScriptedIdleTaskController(ExecutionContext*);
48 48
49 void runCallback(CallbackId, double deadlineSeconds, IdleDeadline::CallbackT ype); 49 void runCallback(CallbackId, double deadlineSeconds, IdleDeadline::CallbackT ype);
50 50
51 WebScheduler* m_scheduler; // Not owned. 51 WebScheduler* m_scheduler; // Not owned.
52 PersistentHeapHashMapWillBeHeapHashMap<CallbackId, Member<IdleRequestCallbac k>> m_callbacks; 52 PersistentHeapHashMapWillBeHeapHashMap<CallbackId, Member<IdleRequestCallbac k>> m_callbacks;
53 Vector<CallbackId> m_pendingTimeouts; 53 Vector<CallbackId> m_pendingTimeouts;
54 CallbackId m_nextCallbackId; 54 CallbackId m_nextCallbackId;
55 bool m_suspended; 55 bool m_suspended;
56 }; 56 };
57 57
58 } // namespace blink 58 } // namespace blink
59 59
60 #endif // ScriptedIdleTaskController_h 60 #endif // ScriptedIdleTaskController_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698