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

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

Issue 1309593003: Oilpan: fix build after r200992. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: DocumentLoadTiming is a part object; adjust Created 5 years, 4 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | Source/core/dom/ScriptedIdleTaskController.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/IdleCallbackDeadline.h" 9 #include "core/dom/IdleCallbackDeadline.h"
10 #include "platform/Timer.h" 10 #include "platform/Timer.h"
11 #include "platform/heap/Handle.h" 11 #include "platform/heap/Handle.h"
12 #include "wtf/RefCounted.h" 12 #include "wtf/RefCounted.h"
13 #include "wtf/RefPtr.h" 13 #include "wtf/RefPtr.h"
14 #include "wtf/Vector.h" 14 #include "wtf/Vector.h"
15 15
16 namespace blink { 16 namespace blink {
17 17
18 class ExecutionContext; 18 class ExecutionContext;
19 class IdleRequestCallback; 19 class IdleRequestCallback;
20 class DocumentLoadTiming; 20 class DocumentLoadTiming;
21 21
22 class ScriptedIdleTaskController : public RefCountedWillBeGarbageCollected<Scrip tedIdleTaskController>, public ActiveDOMObject { 22 class ScriptedIdleTaskController : public RefCountedWillBeGarbageCollectedFinali zed<ScriptedIdleTaskController>, public ActiveDOMObject {
23 DECLARE_EMPTY_DESTRUCTOR_WILL_BE_REMOVED(ScriptedIdleTaskController); 23 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(ScriptedIdleTaskController);
24 public: 24 public:
25 static PassRefPtrWillBeRawPtr<ScriptedIdleTaskController> create(ExecutionCo ntext* context, const DocumentLoadTiming& timing) 25 static PassRefPtrWillBeRawPtr<ScriptedIdleTaskController> create(ExecutionCo ntext* context, const DocumentLoadTiming& timing)
26 { 26 {
27 return adoptRefWillBeNoop(new ScriptedIdleTaskController(context, timing )); 27 return adoptRefWillBeNoop(new ScriptedIdleTaskController(context, timing ));
28 } 28 }
29 ~ScriptedIdleTaskController();
30
29 DECLARE_TRACE(); 31 DECLARE_TRACE();
30 32
31 using CallbackId = int; 33 using CallbackId = int;
32 34
33 int registerCallback(IdleRequestCallback*, double timeoutMillis); 35 int registerCallback(IdleRequestCallback*, double timeoutMillis);
34 void cancelCallback(CallbackId); 36 void cancelCallback(CallbackId);
35 37
36 // ActiveDOMObject interface. 38 // ActiveDOMObject interface.
37 void stop() override; 39 void stop() override;
38 void suspend() override; 40 void suspend() override;
39 void resume() override; 41 void resume() override;
40 bool hasPendingActivity() const override; 42 bool hasPendingActivity() const override;
41 43
42 void callbackFired(CallbackId, double deadlineSeconds, IdleCallbackDeadline: :CallbackType); 44 void callbackFired(CallbackId, double deadlineSeconds, IdleCallbackDeadline: :CallbackType);
43 45
44 private: 46 private:
45 ScriptedIdleTaskController(ExecutionContext*, const DocumentLoadTiming&); 47 ScriptedIdleTaskController(ExecutionContext*, const DocumentLoadTiming&);
46 48
47 void runCallback(CallbackId, double deadlineMillis, IdleCallbackDeadline::Ca llbackType); 49 void runCallback(CallbackId, double deadlineMillis, IdleCallbackDeadline::Ca llbackType);
48 50
49 const DocumentLoadTiming& m_timing; 51 const DocumentLoadTiming& m_timing;
sof 2015/08/22 05:39:49 This const reference to a part object (of a Docume
50 WebScheduler* m_scheduler; // Not owned. 52 WebScheduler* m_scheduler; // Not owned.
51 PersistentHeapHashMapWillBeHeapHashMap<CallbackId, Member<IdleRequestCallbac k>> m_callbacks; 53 PersistentHeapHashMapWillBeHeapHashMap<CallbackId, Member<IdleRequestCallbac k>> m_callbacks;
52 Vector<CallbackId> m_pendingTimeouts; 54 Vector<CallbackId> m_pendingTimeouts;
53 CallbackId m_nextCallbackId; 55 CallbackId m_nextCallbackId;
54 bool m_suspended; 56 bool m_suspended;
55 }; 57 };
56 58
57 } // namespace blink 59 } // namespace blink
58 60
59 #endif // ScriptedIdleTaskController_h 61 #endif // ScriptedIdleTaskController_h
OLDNEW
« no previous file with comments | « no previous file | Source/core/dom/ScriptedIdleTaskController.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698