Coverage Report

Created: 2018-09-25 14:53

/work/obj-fuzz/dist/include/mozilla/dom/IdleRequest.h
Line
Count
Source (jump to first uncovered line)
1
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
3
/* This Source Code Form is subject to the terms of the Mozilla Public
4
 * License, v. 2.0. If a copy of the MPL was not distributed with this
5
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6
7
#ifndef mozilla_dom_idlerequest_h
8
#define mozilla_dom_idlerequest_h
9
10
#include "mozilla/LinkedList.h"
11
#include "mozilla/Maybe.h"
12
#include "mozilla/RefPtr.h"
13
#include "nsCOMPtr.h"
14
#include "nsCycleCollectionParticipant.h"
15
#include "nsDOMNavigationTiming.h"
16
#include "nsICancelableRunnable.h"
17
#include "nsIRunnable.h"
18
#include "nsString.h"
19
20
class nsPIDOMWindowInner;
21
22
namespace mozilla {
23
namespace dom {
24
25
class IdleRequestCallback;
26
27
class IdleRequest final : public LinkedListElement<RefPtr<IdleRequest>>
28
{
29
public:
30
  IdleRequest(IdleRequestCallback* aCallback, uint32_t aHandle);
31
32
  nsresult IdleRun(nsPIDOMWindowInner* aWindow,
33
                   DOMHighResTimeStamp aDeadline,
34
                   bool aDidTimeout);
35
36
  void SetTimeoutHandle(int32_t aHandle);
37
0
  bool HasTimeout() const { return mTimeoutHandle.isSome(); }
38
  uint32_t GetTimeoutHandle() const;
39
40
  uint32_t Handle() const
41
0
  {
42
0
    return mHandle;
43
0
  }
44
45
  NS_DECL_CYCLE_COLLECTION_NATIVE_CLASS(IdleRequest)
46
  NS_INLINE_DECL_CYCLE_COLLECTING_NATIVE_REFCOUNTING(IdleRequest)
47
private:
48
  ~IdleRequest();
49
50
  RefPtr<IdleRequestCallback> mCallback;
51
  const uint32_t mHandle;
52
  mozilla::Maybe<int32_t> mTimeoutHandle;
53
};
54
55
} // namespace dom
56
} // namespace mozilla
57
58
#endif // mozilla_dom_idlerequest_h