Closed Bug 1042908 Opened 10 years ago Closed 10 years ago

Worker error handling should trigger errors on main thread even if worker isn't accepting events.

Categories

(Core :: DOM: Workers, defect)

x86_64
Linux
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla35

People

(Reporter: nsm, Assigned: nsm)

References

Details

Attachments

(1 file, 1 obsolete file)

Due to the IsAcceptingEvents() check before reporting errors to the ServiceWorkerManager or to connected SharedWorkers, sometimes those main thread objects never receive the error.

I am unassigning myself since I'll be on PTO. Ben if this looks good, would you go ahead and land it?
Assignee: nobody → nsm.nikhil
Status: NEW → ASSIGNED
Assignee: nsm.nikhil → nobody
Status: ASSIGNED → NEW
Attachment #8461081 - Flags: review?(bent.mozilla) → review+
IIRC, this had Try failures when bz ran it through there last week (mochitest-4 IIRC). Please verify that this is green first.
Keywords: checkin-needed
Assignee: nobody → nsm.nikhil
Blocks: 1040924
Gate acquiring inner window id on worker accepting events.
Attachment #8487439 - Flags: review?(bent.mozilla)
Comment on attachment 8487439 [details] [diff] [review]
Fix WorkerPrivate error handling

Review of attachment 8487439 [details] [diff] [review]:
-----------------------------------------------------------------

::: dom/workers/WorkerPrivate.cpp
@@ +1315,5 @@
>  
> +      // The innerWindowId is only required if we are going to ReportError
> +      // below, which is gated on this condition. If inner window correctness
> +      // check is only going to succeed when the worker is accepting events.
> +      if (aWorkerPrivate->IsAcceptingEvents()) {

Rather than call this twice (it grabs a lock) just call it once and put a stack var at the top with the result.
Attachment #8487439 - Flags: review?(bent.mozilla) → review+
https://hg.mozilla.org/mozilla-central/rev/e03c9e5816bb
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla35
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: