Intent to Deprecate and Remove: SharedWorker.workerStart

123 views
Skip to first unread message

Nicolás Peña

unread,
Jul 19, 2017, 10:57:37 AM7/19/17
to blin...@chromium.org

Primary eng: n...@chromium.org

Spec: igrig...@chromium.org


Summary

Remove SharedWorker.workerStart because it has been deprecated and is not used. SharedWorkerPerformance.idl can then be removed.


Motivation

We want to be up-to-date with respect to the spec. There is another attribute with the same name: PerformanceResourceTiming.workerStart. Removing the deprecated one reduces confusion. The current spec has a replacement for the deprecated one: performance.timeOrigin.


Interoperability and Compatibility Risk

Edge: not supported

Firefox: not supported (they have performance.timeOrigin)

Safari:not supported


Alternative implementation suggestion for web developers

performance.timeOrigin can be used as a replacement. This needs to be implemented in Chrome: see bug.


Usage information from UseCounter

Usage has been 0.000000 at least since August 26, 2015: https://www.chromestatus.com/metrics/feature/timeline/popularity/885


OWP launch tracking bug

https://bugs.chromium.org/p/chromium/issues/detail?id=745981  


Entry on the feature dashboard

https://www.chromestatus.com/feature/5652075467767808


Rick Byers

unread,
Jul 19, 2017, 11:24:41 AM7/19/17
to Nicolás Peña, blink-dev, Hiroki Nakagawa
Removing zero-usage chrome-only APIs is always a great thing to do - thank you!

But have you verified that you can trigger the UseCounter from a test case?  I know the UseCounter tracking for workers is rather complex (needs to delegate up through the browser process and down to an appropriate renderer), so when the value says absolutely zero like this, we should be a little skeptical on whether or not it's actually getting recorded properly.  I'd suggest creating a simple test page and verifying that after you run it (on current Chrome stable release) that you see an entry in chrome://histograms/Blink.UseCounter.Features for bucket 885.  /cc nhiroki@ who implemented the counter support for workers.

If you can prove that the counter is actually functioning, then LGTM1 (I'll be out until Monday).

Rick



--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CAAATDinr1UbSpXwOm6s%2BxpKQicB5Rs79pxPhGQudu8N-4BqOYA%40mail.gmail.com.

n...@chromium.org

unread,
Jul 19, 2017, 12:21:04 PM7/19/17
to blink-dev, n...@google.com, nhi...@chromium.org
If I open an html file with this

<script>
var worker = new SharedWorker('');
var s = worker.workerStart;
</script>

on Stable (with --allow-file-access-from-files), bucket 885's counter increases.

Rick Byers

unread,
Jul 19, 2017, 1:57:38 PM7/19/17
to n...@chromium.org, blink-dev, Nicolás Peña, Hiroki Nakagawa
Oh I'm sorry, I was thinking this was an API access from within the worker script.  Obviously that's wrong (SharedWorker is the object available in the main world, so this is just our tried-and-tested common use case).  Anyway thanks for double-checking (we've had cases of absolute 0 before which were bugs, it's rare to have an API without at least a tiny bit of usage).

LGTM1 to remove without a deprecation period (being Chrome-only and absolute zero reported usage, there is virtually zero compat risk here IMHO).  Following the normal path of deprecating in Chrome for one milestone and then removing is also OK with me if you prefer.

Rick

Chris Harrelson

unread,
Jul 20, 2017, 2:13:29 PM7/20/17
to Rick Byers, n...@chromium.org, blink-dev, Nicolás Peña, Hiroki Nakagawa
LGTM2

To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+unsubscribe@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CAFUtAY873tddUPbx83VP6RPK9vaDmKyro-bYdRgaCxPMmFSMpA%40mail.gmail.com.

Dimitri Glazkov

unread,
Jul 21, 2017, 10:31:22 AM7/21/17
to Chris Harrelson, Rick Byers, n...@chromium.org, blink-dev, Nicolás Peña, Hiroki Nakagawa
LGTM3

To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.
--
You received this message because you are subscribed to the Google Groups "blink-dev" group.

PhistucK

unread,
Jul 21, 2017, 10:36:16 AM7/21/17
to Nicolás Peña, blink-dev
> performance.timeOrigin can be used as a replacement. This needs to be implemented in Chrome: see bug.

No, it cannot be used as a replacement, because it is not implemented in Chrome (like you mention).
Can you suggest an alternative code that gets the same result as SharedWorker.prototype.workerStart?


PhistucK

--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+unsubscribe@chromium.org.

n...@chromium.org

unread,
Jul 21, 2017, 1:45:36 PM7/21/17
to blink-dev, n...@google.com, Ilya Grigorik
The commit removing translateTime (the initial replacement for workerStart) from the spec has some insight: https://github.com/w3c/hr-time/pull/31/commits/b33c9c7689ef83571c09874b2a368305775037d6

I don't think there is an exact replacement for it, but I'm not worried about it because there was no usage (especially because it was never implemented in other main browsers). If we want to be on the safe side, we could deprecate and only remove until we have shipped timeOrigin.

PhistucK

unread,
Jul 21, 2017, 1:49:30 PM7/21/17
to n...@chromium.org, blink-dev, Nicolás Peña, Ilya Grigorik
Naa, the usage is zero, I would not hold on until the replacement is implemented.
I was just hoping that the alternative section would say more than "use this (but it is not implemented)". :)


PhistucK

Reply all
Reply to author
Forward
0 new messages