Bug 1867190 - Initialise the PHC allocate delay later r=glandium
[gecko.git] / xpcom / threads / nsIDiscardableRunnable.h
blob873b1f5d93e8f2df0ed5e0791e7443e212f4230f
1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* vim: set ts=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 XPCOM_THREADS_NSIDISCARDABLERUNNABLE_H_
8 #define XPCOM_THREADS_NSIDISCARDABLERUNNABLE_H_
10 #include "nsISupports.h"
12 /**
13 * An interface implemented by nsIRunnable tasks for which nsIRunnable::Run()
14 * might not be called.
16 #define NS_IDISCARDABLERUNNABLE_IID \
17 { \
18 0xde93dc4c, 0x755c, 0x4cdc, { \
19 0x96, 0x76, 0x35, 0xc6, 0x48, 0x81, 0x59, 0x78 \
20 } \
23 class NS_NO_VTABLE nsIDiscardableRunnable : public nsISupports {
24 public:
25 NS_DECLARE_STATIC_IID_ACCESSOR(NS_IDISCARDABLERUNNABLE_IID)
27 /**
28 * Called exactly once on a queued task only if nsIRunnable::Run() is not
29 * called.
31 virtual void OnDiscard() = 0;
33 protected:
34 nsIDiscardableRunnable() = default;
35 virtual ~nsIDiscardableRunnable() = default;
38 NS_DEFINE_STATIC_IID_ACCESSOR(nsIDiscardableRunnable,
39 NS_IDISCARDABLERUNNABLE_IID)
41 #endif // XPCOM_THREADS_NSIDISCARDABLERUNNABLE_H_