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

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

Issue 2618893002: Fix memory leak with ScriptedIdleTaskController (Closed)
Patch Set: Improve test Created 3 years, 11 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/IdleDeadline.h" 8 #include "core/dom/IdleDeadline.h"
9 #include "core/dom/SuspendableObject.h" 9 #include "core/dom/SuspendableObject.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/Vector.h" 12 #include "wtf/Vector.h"
13 #include "wtf/WeakPtr.h"
13 14
14 namespace blink { 15 namespace blink {
15 16
16 class ExecutionContext; 17 class ExecutionContext;
17 class IdleRequestCallback; 18 class IdleRequestCallback;
18 class IdleRequestOptions; 19 class IdleRequestOptions;
19 20
20 class ScriptedIdleTaskController 21 class ScriptedIdleTaskController
21 : public GarbageCollectedFinalized<ScriptedIdleTaskController>, 22 : public GarbageCollectedFinalized<ScriptedIdleTaskController>,
22 public SuspendableObject { 23 public SuspendableObject {
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
56 } 57 }
57 58
58 void runCallback(CallbackId, 59 void runCallback(CallbackId,
59 double deadlineSeconds, 60 double deadlineSeconds,
60 IdleDeadline::CallbackType); 61 IdleDeadline::CallbackType);
61 62
62 WebScheduler* m_scheduler; // Not owned. 63 WebScheduler* m_scheduler; // Not owned.
63 HeapHashMap<CallbackId, Member<IdleRequestCallback>> m_callbacks; 64 HeapHashMap<CallbackId, Member<IdleRequestCallback>> m_callbacks;
64 Vector<CallbackId> m_pendingTimeouts; 65 Vector<CallbackId> m_pendingTimeouts;
65 CallbackId m_nextCallbackId; 66 CallbackId m_nextCallbackId;
67 WTF::WeakPtrFactory<ScriptedIdleTaskController> m_weakPtrFactory;
66 bool m_suspended; 68 bool m_suspended;
67 }; 69 };
68 70
69 } // namespace blink 71 } // namespace blink
70 72
71 #endif // ScriptedIdleTaskController_h 73 #endif // ScriptedIdleTaskController_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698