Bug 180041 - Give Document a strongly typed identifier instead of a uint64_t
Summary: Give Document a strongly typed identifier instead of a uint64_t
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: DOM (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Chris Dumez
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2017-11-27 09:47 PST by Chris Dumez
Modified: 2017-11-27 11:52 PST (History)
9 users (show)

See Also:


Attachments
Patch (48.25 KB, patch)
2017-11-27 10:53 PST, Chris Dumez
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Chris Dumez 2017-11-27 09:47:27 PST
Give Document a strongly typed identifier instead of a uint64_t, for clarity.
Comment 1 Chris Dumez 2017-11-27 10:53:55 PST
Created attachment 327648 [details]
Patch
Comment 2 youenn fablet 2017-11-27 10:59:10 PST
Comment on attachment 327648 [details]
Patch

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

> Source/WebCore/workers/service/ServiceWorkerClientIdentifier.h:40
> +    String toString() const { return String::number(serverConnectionIdentifier.toUInt64()) + "-" +  String::number(contextIdentifier.toUInt64()); }

Use StringBuilder?

Also, is this toString() being used to generate client ids, thus potentially exposing to the web page server connection id and context id?
If so, I am wondering whether we should not use some random UUID, at least when exposing the clientId to the web page, or have the storage process generate those random IDs.
Comment 3 Brady Eidson 2017-11-27 11:00:13 PST
Comment on attachment 327648 [details]
Patch

Fine once EWS is happy
Comment 4 Chris Dumez 2017-11-27 11:51:18 PST
Comment on attachment 327648 [details]
Patch

Clearing flags on attachment: 327648

Committed r225184: <https://trac.webkit.org/changeset/225184>
Comment 5 Chris Dumez 2017-11-27 11:51:20 PST
All reviewed patches have been landed.  Closing bug.
Comment 6 Radar WebKit Bug Importer 2017-11-27 11:52:19 PST
<rdar://problem/35703725>