Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expose the "current wall time" #155

Closed
jyasskin opened this issue Apr 4, 2023 · 6 comments · Fixed by #161
Closed

Expose the "current wall time" #155

jyasskin opened this issue Apr 4, 2023 · 6 comments · Fixed by #161

Comments

@jyasskin
Copy link
Member

jyasskin commented Apr 4, 2023

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 (privacycg/nav-tracking-mitigations#37 and WICG/storage-buckets#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.

@yoavweiss
Copy link
Contributor

SGTM! @noamr - thoughts?

@noamr
Copy link
Contributor

noamr commented Apr 11, 2023

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.

@jyasskin
Copy link
Member Author

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.

@noamr
Copy link
Contributor

noamr commented Apr 12, 2023

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.

@clelland
Copy link

@jyasskin, are you planning on making a PR for this?

@jyasskin
Copy link
Member Author

Sure, I can do that: #161

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants