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

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

Issue 1119683003: Implement requestIdleCallback API (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Add LayoutTest and fix minor spec violation 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
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef IdleCallbackDeadline_h
6 #define IdleCallbackDeadline_h
7
8 #include "bindings/core/v8/ScriptWrappable.h"
9 #include "core/dom/ScriptedIdleTaskController.h"
10 #include "platform/heap/Handle.h"
11
12 namespace blink {
13
14 class DocumentLoadTiming;
15
16 class IdleCallbackDeadline : public GarbageCollected<IdleCallbackDeadline>, publ ic ScriptWrappable {
17 DEFINE_WRAPPERTYPEINFO();
18 public:
19 DEFINE_INLINE_TRACE() { }
20 static IdleCallbackDeadline* create(double deadline, bool didTimeout, const DocumentLoadTiming& timing)
jochen (gone - plz use gerrit) 2015/07/31 09:19:19 please use an enum instead of a bool
rmcilroy 2015/08/11 16:30:51 Done.
21 {
22 return new IdleCallbackDeadline(deadline, didTimeout, timing);
23 }
24
25 double deadline()
Sami 2015/08/10 09:47:47 nit: const
rmcilroy 2015/08/11 16:30:51 Done.
26 {
27 return m_deadline;
28 }
29
30 bool didTimeout()
Sami 2015/08/10 09:47:46 nit const
rmcilroy 2015/08/11 16:30:51 Done.
31 {
32 return m_didTimeout;
33 }
34
35 bool isExceeded();
Sami 2015/08/10 09:47:46 nit const
rmcilroy 2015/08/11 16:30:51 Done.
36
37 private:
38 IdleCallbackDeadline(double deadline, bool didTimeout, const DocumentLoadTim ing&);
39
40 double m_deadline;
41 bool m_didTimeout;
42 const DocumentLoadTiming& m_timing;
43 };
44 }
45
46 #endif // IdleCallbackDeadline_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698