Bug 174862 - Performance API: Implement performance.timeOrigin
Summary: Performance API: Implement performance.timeOrigin
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Platform (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Alex Christensen
URL:
Keywords: InRadar, W3CTest, WebExposed, WPTImpact
Depends on:
Blocks:
 
Reported: 2017-07-26 07:52 PDT by Nicolas
Modified: 2021-07-14 09:38 PDT (History)
11 users (show)

See Also:


Attachments
patch (2.31 KB, patch)
2021-06-08 17:50 PDT, Alex Christensen
no flags Details | Formatted Diff | Diff
Patch (7.60 KB, patch)
2021-06-08 19:56 PDT, Alex Christensen
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Nicolas 2017-07-26 07:52:45 PDT
Latest editor draft: https://w3c.github.io/hr-time/

HR-Time-3 introduced this attribute, which is useful for developers to be able to compare timings of entries sourced from different time origins (like windows or workers).

It has already been implemented in Firefox, Edge has it in Preview, and will also be shipped by Chrome[1].

[1] https://groups.google.com/a/chromium.org/forum/#!topic/blink-dev/ck9M6Ev21lo
Comment 1 Radar WebKit Bug Importer 2017-07-27 13:46:00 PDT
<rdar://problem/33575468>
Comment 2 Alex Christensen 2021-06-08 17:50:19 PDT
Created attachment 430926 [details]
patch
Comment 3 Ryosuke Niwa 2021-06-08 18:00:53 PDT
Comment on attachment 430926 [details]
patch

View in context: https://bugs.webkit.org/attachment.cgi?id=430926&action=review

> Source/WebCore/page/Performance.h:78
> +    DOMHighResTimeStamp timeOrigin() const;

Is this time origin varied across origins?
Otherwise, it can create cross-origin tracking vector, right?
Comment 4 Alex Christensen 2021-06-08 18:40:16 PDT
Comment on attachment 430926 [details]
patch

View in context: https://bugs.webkit.org/attachment.cgi?id=430926&action=review

>> Source/WebCore/page/Performance.h:78
>> +    DOMHighResTimeStamp timeOrigin() const;
> 
> Is this time origin varied across origins?
> Otherwise, it can create cross-origin tracking vector, right?

This time stamp is in milliseconds since 1970, so it doesn't identify the user that way.
The value is from the time the DocumentLoader started loading the Document (seen in DOMWindow::performance) or the time that the Worker was created (seen in WorkerGlobalScope::WorkerGlobalScope) which should not lead to a tracking vector.  This value is already indirectly exposed through Performance::now, which is the number of milliseconds since this time.
I'm hoping this is covered by tests.  Waiting on EWS.  If it isn't, I'll write some.
Comment 5 Alex Christensen 2021-06-08 19:56:42 PDT
Created attachment 430935 [details]
Patch
Comment 6 Alex Christensen 2021-06-09 10:01:54 PDT
http://trac.webkit.org/r278665