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 XPCOM_THREADS_NSIDELAYEDRUNNABLEOBSERVER_H_
8 #define XPCOM_THREADS_NSIDELAYEDRUNNABLEOBSERVER_H_
10 #include "nsISupports.h"
13 class DelayedRunnable
;
16 #define NS_IDELAYEDRUNNABLEOBSERVER_IID \
18 0xd226bade, 0xac13, 0x46fe, { \
19 0x9f, 0xcc, 0xde, 0xe7, 0x48, 0x35, 0xcd, 0x82 \
23 class NS_NO_VTABLE nsIDelayedRunnableObserver
: public nsISupports
{
25 NS_DECLARE_STATIC_IID_ACCESSOR(NS_IDELAYEDRUNNABLEOBSERVER_IID
)
28 * Called by the DelayedRunnable after being created, on the dispatching
29 * thread. This allows for various lifetime checks and gives assertions a
30 * chance to provide useful stack traces.
32 virtual void OnDelayedRunnableCreated(
33 mozilla::DelayedRunnable
* aRunnable
) = 0;
35 * Called by the DelayedRunnable on its target thread when delegating the
36 * responsibility for being run to its underlying timer.
38 virtual void OnDelayedRunnableScheduled(
39 mozilla::DelayedRunnable
* aRunnable
) = 0;
41 * Called by the DelayedRunnable on its target thread after having been run by
42 * its underlying timer.
44 virtual void OnDelayedRunnableRan(mozilla::DelayedRunnable
* aRunnable
) = 0;
47 NS_DEFINE_STATIC_IID_ACCESSOR(nsIDelayedRunnableObserver
,
48 NS_IDELAYEDRUNNABLEOBSERVER_IID
)