Closed jyasskin closed 1 year ago
SGTM! @noamr - thoughts?
SG! I think in general it will also be ok to have default-false for current high resolution time
, so that only places that require hi-res time would have to pass a settings object.
current high resolution time
is a duration from a settings object's time origin, so we can't make the settings object optional for that one.
current high resolution time
is a duration from a settings object's time origin, so we can't make the settings object optional for that one.
Of course, right. So your proposal SGTM as is.
@jyasskin, are you planning on making a PR for this?
Sure, I can do that: #161
We currently expose an environment settings object's current wall time, which optionally coarsens the time depending on the settings object's state, but the authors of a couple recent specifications (https://github.com/privacycg/nav-tracking-mitigations/pull/37/ and https://github.com/WICG/storage-buckets/pull/78/) have intuitively referred to the [=current wall time=] without providing a settings object. That's a sensible operation, since the point of a wall time is that it doesn't depend on any particular UA state, but we need to make sure that folks don't accidentally expose high-precision timers.
I suggest we define the
<dfn export for=/>current wall time</dfn>
as the result of calling coarsen time given the wall clock's unsafe current time and the default false value for crossOriginIsolatedCapability. That fails safe (100us resolution) if it's used in a context where it really should have taken a settings object.