Coverage Report

Created: 2018-09-25 14:53

/work/obj-fuzz/dist/include/mozilla/dom/IdleDeadline.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_IdleDeadline_h
8
#define mozilla_dom_IdleDeadline_h
9
10
#include "js/TypeDecls.h"
11
#include "mozilla/Attributes.h"
12
#include "mozilla/ErrorResult.h"
13
#include "mozilla/Maybe.h"
14
#include "mozilla/dom/BindingDeclarations.h"
15
#include "nsCOMPtr.h"
16
#include "nsCycleCollectionParticipant.h"
17
#include "nsDOMNavigationTiming.h"
18
#include "nsWrapperCache.h"
19
20
class nsIGlobalObject;
21
class nsPIDOMWindowInner;
22
23
namespace mozilla {
24
namespace dom {
25
26
class IdleDeadline final
27
  : public nsISupports
28
  , public nsWrapperCache
29
{
30
public:
31
  IdleDeadline(nsPIDOMWindowInner* aWindow, bool aDidTimeout,
32
               DOMHighResTimeStamp aDeadline);
33
34
  IdleDeadline(nsIGlobalObject* aGlobal, bool aDidTimeout,
35
               DOMHighResTimeStamp aDeadline);
36
37
0
  nsIGlobalObject* GetParentObject() const { return mGlobal; }
38
39
  virtual JSObject* WrapObject(JSContext* aCx,
40
                               JS::Handle<JSObject*> aGivenProto) override;
41
42
  DOMHighResTimeStamp TimeRemaining();
43
  bool DidTimeout() const;
44
45
  NS_DECL_CYCLE_COLLECTING_ISUPPORTS
46
  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(IdleDeadline)
47
48
private:
49
  ~IdleDeadline();
50
51
  nsCOMPtr<nsPIDOMWindowInner> mWindow;
52
  nsCOMPtr<nsIGlobalObject> mGlobal;
53
  const bool mDidTimeout;
54
  const DOMHighResTimeStamp mDeadline;
55
};
56
57
} // namespace dom
58
} // namespace mozilla
59
60
#endif // mozilla_dom_IdleDeadline_h