Confirmed users
205
edits
Bevis Tseng (talk | contribs) |
Bevis Tseng (talk | contribs) |
||
Line 271: | Line 271: | ||
<b>A:</b> All the runnables dispatched to '''the main thread of the content process''' shall be labeled. | <b>A:</b> All the runnables dispatched to '''the main thread of the content process''' shall be labeled. | ||
In addition to '''NS_Dispatch(Main|Current)Thread''', there are several ways to | In addition to '''NS_Dispatch(Main|Current)Thread''', there are several ways to dispatch a runnable to the main thread implicitly: | ||
* Any calls to the '''Dispatch()''' method of the subclass of '''nsIEventTarget'''. | * Any calls to the '''Dispatch()''' method of the subclass of '''nsIEventTarget'''. | ||
Line 278: | Line 278: | ||
* Handled the received messages in '''IPC actor childs'''. (A received message will be handled on main thread with a new runnable if its actor child is created on the main thread.) | * Handled the received messages in '''IPC actor childs'''. (A received message will be handled on main thread with a new runnable if its actor child is created on the main thread.) | ||
* Subclass of '''nsExpirationTracker''' (The overriden method of NotifyExpired() will be triggered implicitly with a new runnable by the internal timer in nsExpirationTracker implementation. See the dependency tree of [https://bugzilla.mozilla.org/show_bug.cgi?id=1345464 bug 1345464] for the list of the sub-classes.) | * Subclass of '''nsExpirationTracker''' (The overriden method of NotifyExpired() will be triggered implicitly with a new runnable by the internal timer in nsExpirationTracker implementation. See the dependency tree of [https://bugzilla.mozilla.org/show_bug.cgi?id=1345464 bug 1345464] for the list of the sub-classes.) | ||
* The use of '''AsyncWait()''' on any '''nsIAsync(In|Out)putStream''' . (These use cases trigger new runnables named '''(In|Out)putStreamReadyEvent''' to the specified nsIEventTarget in the invocation of AsyncWait(). These runnables need to be labeled if the nsIEventTarget points to the main thread.) | * The use of '''AsyncWait()''' on any '''nsIAsync(In|Out)putStream''' or the use of '''NS_NewInputStreamPump()'''. (These use cases trigger new runnables named '''(In|Out)putStreamReadyEvent''' to the specified nsIEventTarget in the invocation of AsyncWait(). These runnables need to be labeled if the nsIEventTarget points to the main thread.) | ||
* The use of '''NS_ProxyRelease''' on main thread or ''' | * The use of '''NS_ProxyRelease''' on main thread, '''NS_ReleaseOnMainThread''', or '''nsMainThreadPtrHolder'''. | ||
=== Q4: How do I specify a label for an nsITimer TimerCallback? === | === Q4: How do I specify a label for an nsITimer TimerCallback? === |