Closed Bug 1249102 Opened 9 years ago Closed 9 years ago

Make overrides of WorkerRunnable::PostRun a bit more consistent

Categories

(Core :: DOM: Workers, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla47
Tracking Status
firefox47 --- fixed

People

(Reporter: bzbarsky, Assigned: bzbarsky)

References

Details

(Whiteboard: dom-triaged btpp-active)

Attachments

(1 file)

Right now they do similar things in somewhat different ways. It would really be better if they didn't do that.
Whiteboard: dom-triaged btpp-active
Specifically we make the following changes: 1) Remove WorkerSameThreadRunnable::PostRun, because it does exactly the same things as WorkerRunnable::PostRun. 2) Always treat ModifyBusyCountFromWorker as infallible in terms of throwing JS exceptions. 3) Change ExtendableFunctionalEventWorkerRunnable::PostRun to properly call its superclass PostRun so we will correctly decrement the busy count our PreDispatch incremented.
Attachment #8720635 - Flags: review?(khuey)
Comment on attachment 8720635 [details] [diff] [review] Make overrides of WorkerRunnable::PostRun a bit more consistent Review of attachment 8720635 [details] [diff] [review]: ----------------------------------------------------------------- Can we go ahead and nerf ModifyBusyCountFromWorker's return value too? You might want the commit message to mention Pre/PostDispatch too. ::: dom/base/WebSocket.cpp @@ +2703,5 @@ > PreDispatch(JSContext* aCx, WorkerPrivate* aWorkerPrivate) > { > + // We don't call WorkerRunnable::PreDispatch because it would assert the > + // wrong thing about which thread we're on. Which thread _are_ we on, > + // exactly? That's an *excellent* question. I think you're on either the main thread or the STS thread. See WebSocketImpl::InitializeConnection and the retargeting, and note that WebSocketImpl is an nsIEventTarget.
Attachment #8720635 - Flags: review?(khuey) → review+
> Can we go ahead and nerf ModifyBusyCountFromWorker's return value too? I _think_ so, but would really rather do that in a followup or something. > You might want the commit message to mention Pre/PostDispatch too. Will do. > I think you're on either the main thread or the STS thread. Ah, indeed. Will document that we're on the thread the channel implementation is running on, which I agree should generally be main or STS.
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla47
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: