Add name option to workers

RESOLVED FIXED in Firefox 55

Status

()

P3
normal
RESOLVED FIXED
2 years ago
2 years ago

People

(Reporter: d, Assigned: baku)

Tracking

({dev-doc-complete})

55 Branch
mozilla55
dev-doc-complete
Points:
---

Firefox Tracking Flags

(firefox55 fixed)

Details

Attachments

(2 attachments)

(Reporter)

Description

2 years ago
We added names to dedicated workers in HTML, mainly for debugging purposes, based on a WebKit request: https://github.com/whatwg/html/commit/3bb652169741d5dd94d7f1b390f6491e38d640cb. This supplements how shared workers already have names. This is also tied up in the WorkerOptions version of the Worker/SharedWorker constructors used for module workers, but it's possible to implement just the name part of WorkerOptions without any module stuff.

Tests:

- http://w3c-test.org/workers/name-property.html
- http://w3c-test.org/workers/shared-worker-name-via-options.html

The actual spec PR was merged a bit prematurely; multiple vendors were on board with the idea, but not everyone got a chance to review the final proposed API shape. So if there are objections please let us know and we can revise the spec or revert it.
Ben, looks this is a nice but not super critical enhancement. Let me know if we want to get it prioritized.
Priority: -- → P3
(Assignee)

Updated

2 years ago
Assignee: nobody → amarchesini
(Assignee)

Comment 2

2 years ago
Created attachment 8868475 [details] [diff] [review]
option.patch
Attachment #8868475 - Flags: review?(bugs)
I'd prefer storing the string as normal nsString, not nsCString, unless there is some good reason to use nsCString.
(Assignee)

Updated

2 years ago
Attachment #8868475 - Flags: review?(bugs)
(Assignee)

Comment 4

2 years ago
Created attachment 8868532 [details] [diff] [review]
nsCString to nsString

I had to split ServiceWorkerScope from WorkerName. This makes sense, btw.
Attachment #8868532 - Flags: review?(bugs)
Attachment #8868475 - Flags: review?(bugs) → review+
Attachment #8868532 - Flags: review?(bugs) → review+

Comment 5

2 years ago
Pushed by amarchesini@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/df81d9654736
Worker and SharedWorker constructors have an optional WorkerOptions parameter, r=smaug
https://hg.mozilla.org/integration/mozilla-inbound/rev/d52a1c7cf0a3
Use nsString instead nsCString for Worker names, r=smaug

Comment 6

2 years ago
bugherder
https://hg.mozilla.org/mozilla-central/rev/df81d9654736
https://hg.mozilla.org/mozilla-central/rev/d52a1c7cf0a3
Status: NEW → RESOLVED
Last Resolved: 2 years ago
status-firefox55: --- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla55
Keywords: dev-doc-needed
You need to log in before you can comment on or make changes to this bug.