Confirmed users
130
edits
Wmccloskey (talk | contribs) (add SystemGroup explanation) |
Wmccloskey (talk | contribs) (runnable naming convention) |
||
Line 48: | Line 48: | ||
NewRunnableMethod(this, &nsDocument::UpdateVisibilityState); | NewRunnableMethod(this, &nsDocument::UpdateVisibilityState); | ||
- NS_DispatchToMainThread(event); | - NS_DispatchToMainThread(event); | ||
+ Dispatch(" | + Dispatch("nsDocument::UpdateVisibilityState", TaskCategory::Other, event.forget()); | ||
} | } | ||
== Runnable naming convention == | |||
Runnables should be named as follows: | |||
* If the runnable is a class that you define, its name should be the name of the class. Namespaces can be left off unless they are necessary for disambiguation. For example, if the runnable is simply called <code>Runnable</code>, then a namespace should be included. But if the runnable is <code>mozilla::dom::OffThreadScriptRunnable</code>, then the namespaces can be omitted. | |||
* If the runnable is a method (created via some variant of NewRunnableMethod), then the class name and method name should form the name. <code>"nsDocument::UpdateVisibilityState"</code> is a good example. Namespaces should be omitted as before unless they're necessary. | |||
* If the runnable is a function created via NewRunnableFunction, follow the rule as if it were a class. | |||
* If the runnable name would be ambiguous <i>and</i> it lives in an anonymous namespace, then make up a namespace that seems right. | |||
== Event Targets == | == Event Targets == |