Bug 1750871 - run mochitest-remote on fission everywhere. r=releng-reviewers,aki
[gecko.git] / dom / base / IdleDeadline.h
blob10f149e63cd5197347378c955542a10333ca3176
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/. */
7 #ifndef mozilla_dom_IdleDeadline_h
8 #define mozilla_dom_IdleDeadline_h
10 #include "js/TypeDecls.h"
11 #include "mozilla/Attributes.h"
12 #include "mozilla/Maybe.h"
13 #include "mozilla/dom/BindingDeclarations.h"
14 #include "nsCOMPtr.h"
15 #include "nsCycleCollectionParticipant.h"
16 #include "nsDOMNavigationTiming.h"
17 #include "nsWrapperCache.h"
19 class nsIGlobalObject;
20 class nsPIDOMWindowInner;
22 namespace mozilla {
23 namespace dom {
25 class IdleDeadline final : public nsISupports, public nsWrapperCache {
26 public:
27 IdleDeadline(nsPIDOMWindowInner* aWindow, bool aDidTimeout,
28 DOMHighResTimeStamp aDeadline);
30 IdleDeadline(nsIGlobalObject* aGlobal, bool aDidTimeout,
31 DOMHighResTimeStamp aDeadline);
33 nsIGlobalObject* GetParentObject() const { return mGlobal; }
35 virtual JSObject* WrapObject(JSContext* aCx,
36 JS::Handle<JSObject*> aGivenProto) override;
38 DOMHighResTimeStamp TimeRemaining();
39 bool DidTimeout() const;
41 NS_DECL_CYCLE_COLLECTING_ISUPPORTS
42 NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(IdleDeadline)
44 private:
45 ~IdleDeadline();
47 nsCOMPtr<nsPIDOMWindowInner> mWindow;
48 nsCOMPtr<nsIGlobalObject> mGlobal;
49 const bool mDidTimeout;
50 const DOMHighResTimeStamp mDeadline;
53 } // namespace dom
54 } // namespace mozilla
56 #endif // mozilla_dom_IdleDeadline_h