Interface nsIMessageLoopType

This service allows access to the current thread's Chromium MessageLoop instance, with some extra sugar added. If you're calling from C++, it may or may not make sense for you to use this interface. If you're calling from JS, you don't have a choice!

Right now, you can only call PostIdleTask(), and the wrath of khuey is stopping you from adding other methods.

nsIMessageLoop's contractid is "@mozilla.org/message-loop;1".

Hierarchy

Methods

  • Increases the reference count for this interface. The associated instance will not be deleted unless the reference count is returned to zero.

    Returns

    The resulting reference count.

    Returns number

  • Parameters

    • aIID: object
    • Optional aInstancePtr: object

    Returns any

  • A run time mechanism for interface discovery.

    Returns

    NS_OK if the interface is supported by the associated instance, NS_NOINTERFACE if it is not.

    aInstancePtr must not be null.

    Parameters

    • aIID: object

      [in] A requested interface IID

    • aInstancePtr: object

      [out] A pointer to an interface pointer to receive the result.

    Returns void

  • Decreases the reference count for this interface. Generally, if the reference count returns to zero, the associated instance is deleted.

    Returns

    The resulting reference count.

    Returns number

  • Posts a task to be run when this thread's message loop is idle, or after ensureRunsAfterMS milliseconds have elapsed. (That is, the task is guaranteed to run /eventually/.)

    Note that if the event loop is busy, we will hold a reference to the task until ensureRunsAfterMS milliseconds have elapsed. Be careful when specifying long timeouts and tasks which hold references to windows or other large objects, because you can leak memory in a difficult-to-detect way!

    Parameters

    • task: nsIRunnable
    • ensureRunsAfterMS: uint32_t

    Returns void

Generated using TypeDoc