Back to index

lightning-sunbird  0.9+nobinonly
Public Member Functions | Private Member Functions | Private Attributes
nsTimerManager Class Reference

#include <nsTimerImpl.h>

Inheritance diagram for nsTimerManager:
Inheritance graph
[legend]
Collaboration diagram for nsTimerManager:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 nsTimerManager ()
 Timer Manager code.
NS_DECL_ISUPPORTS
NS_DECL_NSITIMERMANAGER
nsresult 
AddIdleTimer (nsITimer *timer)

Private Member Functions

 ~nsTimerManager ()
boolean hasIdleTimers ()
void fireNextIdleTimer ()

Private Attributes

PRLockmLock
nsVoidArray mIdleTimers
attribute boolean useIdleTimers
 A flag that turns on the use of idle timers on the main thread.

Detailed Description

Definition at line 178 of file nsTimerImpl.h.


Constructor & Destructor Documentation

Timer Manager code.

Definition at line 553 of file nsTimerImpl.cpp.

{
  mLock = PR_NewLock();
  gManager = this;
}

Here is the call graph for this function:

Definition at line 559 of file nsTimerImpl.cpp.

{
  gManager = nsnull;
  PR_DestroyLock(mLock);

  nsTimerImpl *theTimer;
  PRInt32 count = mIdleTimers.Count();

  for (PRInt32 i = 0; i < count; i++) {
    theTimer = NS_STATIC_CAST(nsTimerImpl*, mIdleTimers[i]);
    NS_IF_RELEASE(theTimer);
  }
}

Here is the call graph for this function:


Member Function Documentation

Definition at line 597 of file nsTimerImpl.cpp.

{
  if (!timer)
    return NS_ERROR_FAILURE;
  nsAutoLock lock(mLock);
  mIdleTimers.AppendElement(timer);
  NS_ADDREF(timer);
  return NS_OK;
}

Here is the call graph for this function:

Here is the caller graph for this function:


Member Data Documentation

Definition at line 191 of file nsTimerImpl.h.

Definition at line 190 of file nsTimerImpl.h.

A flag that turns on the use of idle timers on the main thread.

this should only be called once.

By default, idle timers are off.

One this is set to TRUE, you are expected to call hasIdleTimers/fireNextIdleTimer when you have time in your main loop.

Definition at line 55 of file nsITimerManager.idl.


The documentation for this class was generated from the following files: