Closed
Bug 1049599
Opened 10 years ago
Closed 10 years ago
ServiceWorkers handled inconsistently in RuntimeService::CancelWorkersForWindow() and WorkerPrivateParent::CloseSharedWorkersForWindow()
Categories
(Core :: DOM: Workers, defect)
Core
DOM: Workers
Tracking
()
RESOLVED
FIXED
mozilla35
People
(Reporter: bkelly, Assigned: nsm)
References
Details
Attachments
(1 file)
(deleted),
patch
|
bent.mozilla
:
review+
|
Details | Diff | Splinter Review |
I noticed recently that we have this code in RuntimeService::CancelWorkerForWindow():
if (worker->IsSharedWorker()) {
worker->CloseSharedWorkersForWindow(aWindow);
} else if (!worker->Cancel(cx)) {
JS_ReportPendingException(cx);
}
But then in WorkerPrivateParent::CloseSharedWorkersForWindow() we have:
MOZ_ASSERT(IsSharedWorker() || IsServiceWorker());
It seems to me that either the first one needs:
if (worker->IsSharedWorker() || worker->IsServiceWorker()) {
worker->CloseSharedWorkersForWindow(aWindow);
}
Or we need to restrict MOZ_ASSERT in the second case.
Reporter | ||
Updated•10 years ago
|
Summary: ServiceWorkers handle inconsistently in RuntimeService::CancelWorkersForWindow() and WorkerPrivateParent::CloseSharedWorkersForWindow() → ServiceWorkers handled inconsistently in RuntimeService::CancelWorkersForWindow() and WorkerPrivateParent::CloseSharedWorkersForWindow()
Reporter | ||
Comment 1•10 years ago
|
||
Seems like this could be the source of some crashers in our SW tests as the worker might not get shutdown properly when the document goes away.
Assignee | ||
Comment 2•10 years ago
|
||
Added the IsServiceWorker() check to RuntimeService. This will at least decrease the 'reference count' of the WorkerPrivate in a sane way when client JS is holding on to ServiceWorker instances when the window goes away. I'm not sure if that prevents any crashes though.
Attachment #8477959 -
Flags: review?(bent.mozilla)
Assignee | ||
Updated•10 years ago
|
Assignee: nobody → nsm.nikhil
Status: NEW → ASSIGNED
Updated•10 years ago
|
Attachment #8477959 -
Flags: review?(bent.mozilla) → review+
Assignee | ||
Comment 3•10 years ago
|
||
Keywords: checkin-needed
Comment 4•10 years ago
|
||
Keywords: checkin-needed
Comment 5•10 years ago
|
||
Status: ASSIGNED → 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.
Description
•