New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 721219 link

Starred by 4 users

Issue metadata

Status: Fixed
Owner:
Last visit > 30 days ago
Closed: Aug 24
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Feature



Sign in to add a comment

Add "name" option to dedicated workers for debugging

Project Member Reported by nhiroki@chromium.org, May 11 2017

Issue description

Comment 2 by d@domenic.me, Jun 27 2017

Note that we just changed the spec to make it [Replaceable], to avoid compatibility problem Firefox discovered while implementing. The tests are updated to reflect this minor change.

Comment 3 by a...@scirra.com, Jan 31 2018

Would be great to have the name supported and displayed in dev tools to help with debugging workers.
Owner: nhiroki@chromium.org
Status: Assigned (was: Available)
Cc: nhiroki@chromium.org
Owner: asamidoi@google.com
Status: Started (was: Assigned)
Project Member

Comment 6 by bugdroid1@chromium.org, Aug 15

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/42dcb573d0aff2e2e1b349c4c200dbbaaf0405de

commit 42dcb573d0aff2e2e1b349c4c200dbbaaf0405de
Author: Asami Doi <asamidoi@google.com>
Date: Wed Aug 15 03:44:06 2018

Worker: Add 'name' option to WorkerOptions

This CL adds a new 'name' option to the WorkerOptions dictionary,
but not fully implement it yet and instead shows the console message.
Subsequent CLs will implement it.

Spec: https://html.spec.whatwg.org/multipage/workers.html#workeroptions

Bug:  721219 
Change-Id: Ie03ab85a9c3d5636017cc72e3389394b120da508
Reviewed-on: https://chromium-review.googlesource.com/1174581
Commit-Queue: Asami Doi <asamidoi@google.com>
Reviewed-by: Hiroki Nakagawa <nhiroki@chromium.org>
Cr-Commit-Position: refs/heads/master@{#583152}
[modify] https://crrev.com/42dcb573d0aff2e2e1b349c4c200dbbaaf0405de/third_party/blink/renderer/core/workers/dedicated_worker.cc
[modify] https://crrev.com/42dcb573d0aff2e2e1b349c4c200dbbaaf0405de/third_party/blink/renderer/core/workers/worker_options.idl

Comment 7 Deleted

Do we have a sense of the compatibility status? Looking at the bugs  Domenic filed at https://github.com/whatwg/html/pull/2664#issuecomment-300978686  (thanks for that!) it looks like Firefox and Edge support this and Safari not yet. Given that it seems fine to go ahead with this.

Is the plan to do this for shared workers too? Should we file a bug about that?
Yeah, this seems to have enough supports from other vendors. We'll create a chromestatus entry and update the compatibility status there.

SharedWorkerGlobalScope has already supported the 'name' property, but web-platform-test are still failing because it doesn't have [replaceable] attribute and the ctor of SharedWorker doesn't support WorkerOptions.

asamidoi@: Can you file a new issue for shared workers?
Project Member

Comment 10 by bugdroid1@chromium.org, Aug 23

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/88937c31aa017301a3856a076fe283a3b9012e9c

commit 88937c31aa017301a3856a076fe283a3b9012e9c
Author: Asami Doi <asamidoi@google.com>
Date: Thu Aug 23 01:06:58 2018

Worker: Implement the 'name' attribute to DedicatedWorkerGlobalScope

This CL allows a user to use 'name' property on DedicatedWorker
and access from worker thread by 'self.name'.

i.e
// index.html
const worker = new Worker("dedicated_worker.js", { name: "worker_name" });

// dedicated_worker.js
console.log(self.name); // worker_name

Intent to Ship: https://groups.google.com/a/chromium.org/d/msg/blink-dev/aZ804HggENE/WwWgDrz4DgAJ

Spec: https://html.spec.whatwg.org/multipage/workers.html#workeroptions
Spec: https://html.spec.whatwg.org/multipage/workers.html#dedicated-workers-and-the-dedicatedworkerglobalscope-interface

Bug:  721219 
Change-Id: I36127df5ee249ecf6c13ae30aaac42621b3720b5
Reviewed-on: https://chromium-review.googlesource.com/1176887
Reviewed-by: Philip Jägenstedt <foolip@chromium.org>
Reviewed-by: Hiroki Nakagawa <nhiroki@chromium.org>
Reviewed-by: Matt Falkenhagen <falken@chromium.org>
Commit-Queue: Asami Doi <asamidoi@google.com>
Cr-Commit-Position: refs/heads/master@{#585348}
[modify] https://crrev.com/88937c31aa017301a3856a076fe283a3b9012e9c/third_party/WebKit/LayoutTests/TestExpectations
[modify] https://crrev.com/88937c31aa017301a3856a076fe283a3b9012e9c/third_party/WebKit/LayoutTests/external/wpt/workers/interfaces.worker-expected.txt
[modify] https://crrev.com/88937c31aa017301a3856a076fe283a3b9012e9c/third_party/WebKit/LayoutTests/external/wpt/workers/name-property-expected.txt
[modify] https://crrev.com/88937c31aa017301a3856a076fe283a3b9012e9c/third_party/WebKit/LayoutTests/virtual/stable/webexposed/global-interface-listing-dedicated-worker-expected.txt
[modify] https://crrev.com/88937c31aa017301a3856a076fe283a3b9012e9c/third_party/WebKit/LayoutTests/webexposed/global-interface-listing-dedicated-worker-expected.txt
[modify] https://crrev.com/88937c31aa017301a3856a076fe283a3b9012e9c/third_party/blink/renderer/core/workers/dedicated_worker.cc
[modify] https://crrev.com/88937c31aa017301a3856a076fe283a3b9012e9c/third_party/blink/renderer/core/workers/dedicated_worker.h
[modify] https://crrev.com/88937c31aa017301a3856a076fe283a3b9012e9c/third_party/blink/renderer/core/workers/dedicated_worker_global_scope.cc
[modify] https://crrev.com/88937c31aa017301a3856a076fe283a3b9012e9c/third_party/blink/renderer/core/workers/dedicated_worker_global_scope.h
[modify] https://crrev.com/88937c31aa017301a3856a076fe283a3b9012e9c/third_party/blink/renderer/core/workers/dedicated_worker_global_scope.idl
[modify] https://crrev.com/88937c31aa017301a3856a076fe283a3b9012e9c/third_party/blink/renderer/core/workers/dedicated_worker_messaging_proxy.cc
[modify] https://crrev.com/88937c31aa017301a3856a076fe283a3b9012e9c/third_party/blink/renderer/core/workers/dedicated_worker_test.cc
[modify] https://crrev.com/88937c31aa017301a3856a076fe283a3b9012e9c/third_party/blink/renderer/core/workers/dedicated_worker_thread.cc
[modify] https://crrev.com/88937c31aa017301a3856a076fe283a3b9012e9c/third_party/blink/renderer/core/workers/dedicated_worker_thread.h

Labels: M-70
Status: Fixed (was: Started)
Please update Chrome Status. https://www.chromestatus.com/features/4594144336936960
Cc: danyao@chromium.org
 Issue 815116  has been merged into this issue.

Sign in to add a comment