Let's please use a backdoor with nsIDOMWindowUtils or something. Or make a new interface if you need it in places without a window (components, JSM, etc). Making nsIAppShell scriptable sounds awful.
Created attachment 752565 [details] [diff] [review] expose runBeforeNextEvent and runInStableState on nsIDOMWindowUtils I thought briefly about adding a separate service, but this seemed like a more expedient way. I'm willing to listen to reason, though.
Attachment #752565 - Flags: review?(bent.mozilla)
Comment on attachment 752565 [details] [diff] [review] expose runBeforeNextEvent and runInStableState on nsIDOMWindowUtils Review of attachment 752565 [details] [diff] [review]: ----------------------------------------------------------------- r=me ::: dom/base/nsDOMWindowUtils.cpp @@ +3318,5 @@ > + } > + > + nsCOMPtr<nsIAppShell> appShell(do_GetService(kAppShellCID)); > + if (!appShell) > + return NS_ERROR_NOT_AVAILABLE; Nit: braces here and below. ::: dom/interfaces/base/nsIDOMWindowUtils.idl @@ +1379,5 @@ > + * In practice this runs aRunnable once the currently executing event > + * finishes. If called multiple times per task/event, all the runnables will > + * be executed, in the order in which runInStableState() was called. > + */ > + void runInStableState(in nsIRunnable runnable); Might want to add a big XXX comment saying that these methods can wreak all sorts of havoc if the runnable does anything but twiddle a few bits or something...
Attachment #752565 - Flags: review?(bent.mozilla) → review+
Status: NEW → RESOLVED
Last Resolved: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla24
You need to log in before you can comment on or make changes to this bug.