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.
6 #include "core/dom/IdleDeadline.h"
8 #include "wtf/CurrentTime.h"
12 IdleDeadline::IdleDeadline(double deadlineSeconds
, CallbackType callbackType
)
13 : m_deadlineSeconds(deadlineSeconds
)
14 , m_callbackType(callbackType
)
18 double IdleDeadline::timeRemaining() const
20 double timeRemaining
= m_deadlineSeconds
- monotonicallyIncreasingTime();
21 if (timeRemaining
< 0)
24 return timeRemaining
* 1000;