Chromium Code Reviews| Index: Source/core/dom/IdleCallbackDeadline.h |
| diff --git a/Source/core/dom/IdleCallbackDeadline.h b/Source/core/dom/IdleCallbackDeadline.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..577e42bf40c9c8c06fe780912d8b9c5ff619e0b2 |
| --- /dev/null |
| +++ b/Source/core/dom/IdleCallbackDeadline.h |
| @@ -0,0 +1,46 @@ |
| +// Copyright 2015 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef IdleCallbackDeadline_h |
| +#define IdleCallbackDeadline_h |
| + |
| +#include "bindings/core/v8/ScriptWrappable.h" |
| +#include "core/dom/ScriptedIdleTaskController.h" |
| +#include "platform/heap/Handle.h" |
| + |
| +namespace blink { |
| + |
| +class DocumentLoadTiming; |
| + |
| +class IdleCallbackDeadline : public GarbageCollected<IdleCallbackDeadline>, public ScriptWrappable { |
| + DEFINE_WRAPPERTYPEINFO(); |
| +public: |
| + DEFINE_INLINE_TRACE() { } |
| + 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.
|
| + { |
| + return new IdleCallbackDeadline(deadline, didTimeout, timing); |
| + } |
| + |
| + double deadline() |
|
Sami
2015/08/10 09:47:47
nit: const
rmcilroy
2015/08/11 16:30:51
Done.
|
| + { |
| + return m_deadline; |
| + } |
| + |
| + bool didTimeout() |
|
Sami
2015/08/10 09:47:46
nit const
rmcilroy
2015/08/11 16:30:51
Done.
|
| + { |
| + return m_didTimeout; |
| + } |
| + |
| + bool isExceeded(); |
|
Sami
2015/08/10 09:47:46
nit const
rmcilroy
2015/08/11 16:30:51
Done.
|
| + |
| +private: |
| + IdleCallbackDeadline(double deadline, bool didTimeout, const DocumentLoadTiming&); |
| + |
| + double m_deadline; |
| + bool m_didTimeout; |
| + const DocumentLoadTiming& m_timing; |
| +}; |
| +} |
| + |
| +#endif // IdleCallbackDeadline_h |