Bug 234534

Summary: Make Notification identifiers be a UUID string instead of a uint64_t
Product: WebKit Reporter: Brady Eidson <beidson>
Component: WebKit WebsiteAssignee: Brady Eidson <beidson>
Status: RESOLVED FIXED    
Severity: Normal CC: achristensen, benjamin, cdumez, cmarcelo, ews-watchlist, jond, ryanhaddad, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Does it build and test v1
none
Does it build and test v2
ews-feeder: commit-queue-
Does it build and test v3
none
Does it build and test v3.1
none
PFR
achristensen: review+
PFL v1 none

Brady Eidson
Reported 2021-12-20 15:54:32 PST
Make Notification identifiers be a UUID string instead of a uint64_t This will let the identifier assigned at creation time in each WebProcess be global across the entire process ecosystem, simplifying a lot of code.
Attachments
Does it build and test v1 (69.96 KB, patch)
2021-12-20 20:08 PST, Brady Eidson
no flags
Does it build and test v2 (70.14 KB, patch)
2021-12-20 20:17 PST, Brady Eidson
ews-feeder: commit-queue-
Does it build and test v3 (70.13 KB, patch)
2021-12-20 20:41 PST, Brady Eidson
no flags
Does it build and test v3.1 (69.99 KB, patch)
2021-12-20 20:43 PST, Brady Eidson
no flags
PFR (80.23 KB, patch)
2021-12-21 09:35 PST, Brady Eidson
achristensen: review+
PFL v1 (80.34 KB, patch)
2021-12-21 14:53 PST, Brady Eidson
no flags
Brady Eidson
Comment 1 2021-12-20 20:08:47 PST
Created attachment 447676 [details] Does it build and test v1
Brady Eidson
Comment 2 2021-12-20 20:17:12 PST
Created attachment 447677 [details] Does it build and test v2
Brady Eidson
Comment 3 2021-12-20 20:41:42 PST
Created attachment 447681 [details] Does it build and test v3
Brady Eidson
Comment 4 2021-12-20 20:43:09 PST
Created attachment 447682 [details] Does it build and test v3.1
Alex Christensen
Comment 5 2021-12-20 22:13:16 PST
Comment on attachment 447682 [details] Does it build and test v3.1 I wonder if it would be worth making a better storage for WTF::UUID that stores a std::pair<uint64_t, uint64_t> and generates the string on demand.
Brady Eidson
Comment 6 2021-12-21 08:33:42 PST
(In reply to Alex Christensen from comment #5) > Comment on attachment 447682 [details] > Does it build and test v3.1 > > I wonder if it would be worth making a better storage for WTF::UUID that > stores a std::pair<uint64_t, uint64_t> and generates the string on demand. Now that we're identifying more than one class via UUID, I think it's very worth having that discussion. I had the same thought before I went to WTF/UUID - If we had a nice and easy to use 128bit int type I could've rolled my own with <WebPageProxyIdentifier + per-WebContent-generated-uint64_t> And that system would probably be generally applicable to many/most UUID users.
Brady Eidson
Comment 7 2021-12-21 09:35:09 PST
Brady Eidson
Comment 8 2021-12-21 11:30:21 PST
Filed https://bugs.webkit.org/show_bug.cgi?id=234571 for making UUID be a 128bit integer instead of a String.
Alex Christensen
Comment 9 2021-12-21 14:31:28 PST
Comment on attachment 447726 [details] PFR View in context: https://bugs.webkit.org/attachment.cgi?id=447726&action=review > Source/WebKit/UIProcess/Notifications/WebNotificationManagerProxy.cpp:95 > + m_notifications.set(notification->coreNotificationID(), notification.copyRef()); I'm not sure if copyRef is needed these days. > Source/WebKit/UIProcess/Notifications/WebNotificationManagerProxy.cpp:140 > for (auto it = m_notifications.begin(), end = m_notifications.end(); it != end; ++it) { Can this be a C++11-style for loop? > Source/WebKit/UIProcess/Notifications/WebNotificationManagerProxy.cpp:181 > + ASSERT(notification); We have lots of early returns elsewhere in this function. Maybe an early return with an assert not reached to be more robust? > Source/WebKit/UIProcess/Notifications/WebNotificationManagerProxy.h:91 > + HashMap<uint64_t, String> m_globalNotificationMap; Can this be a typed identifier? > Source/WebKit/UIProcess/Notifications/WebNotificationManagerProxy.h:92 > + HashMap<String, RefPtr<WebNotification>> m_notifications; I think the value can be a Ref.
Brady Eidson
Comment 10 2021-12-21 14:42:09 PST
Most feedback addressed without additional comment. As for this one: (In reply to Alex Christensen from comment #9) > > > Source/WebKit/UIProcess/Notifications/WebNotificationManagerProxy.h:91 > > + HashMap<uint64_t, String> m_globalNotificationMap; > > Can this be a typed identifier? This will become a new UUID type in the next patch
Brady Eidson
Comment 11 2021-12-21 14:53:09 PST
EWS
Comment 12 2021-12-21 18:32:59 PST
Committed r287339 (245481@main): <https://commits.webkit.org/245481@main> All reviewed patches have been landed. Closing bug and clearing flags on attachment 447753 [details].
Radar WebKit Bug Importer
Comment 13 2021-12-21 18:34:18 PST
Ryan Haddad
Comment 14 2021-12-22 14:04:39 PST
*** Bug 234437 has been marked as a duplicate of this bug. ***
Ryan Haddad
Comment 15 2021-12-22 14:04:54 PST
*** Bug 234436 has been marked as a duplicate of this bug. ***
Note You need to log in before you can comment on or make changes to this bug.