Bug 236545 - Implement ServiceWorkerRegistration.getNotifications()
Summary: Implement ServiceWorkerRegistration.getNotifications()
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit Misc. (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Brady Eidson
URL:
Keywords: InRadar
Depends on: 22722
Blocks:
  Show dependency treegraph
 
Reported: 2022-02-12 17:13 PST by Brady Eidson
Modified: 2022-02-15 17:27 PST (History)
6 users (show)

See Also:


Attachments
EWS v1 (15.42 KB, patch)
2022-02-14 17:08 PST, Brady Eidson
ews-feeder: commit-queue-
Details | Formatted Diff | Diff
EWS v2 (15.46 KB, patch)
2022-02-14 18:30 PST, Brady Eidson
ews-feeder: commit-queue-
Details | Formatted Diff | Diff
EWS v3 (15.65 KB, patch)
2022-02-15 09:15 PST, Brady Eidson
no flags Details | Formatted Diff | Diff
PFR (16.30 KB, patch)
2022-02-15 11:55 PST, Brady Eidson
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Brady Eidson 2022-02-12 17:13:32 PST
Implement ServiceWorkerRegistration.getNotifications()

Obvious and required followup to https://bugs.webkit.org/show_bug.cgi?id=22722
Comment 1 Brady Eidson 2022-02-14 17:08:07 PST
Created attachment 451965 [details]
EWS v1
Comment 2 Brady Eidson 2022-02-14 18:30:53 PST
Created attachment 451975 [details]
EWS v2
Comment 3 Brady Eidson 2022-02-15 09:15:33 PST
Created attachment 452032 [details]
EWS v3
Comment 4 Alex Christensen 2022-02-15 09:32:25 PST
Comment on attachment 452032 [details]
EWS v3

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

> Source/WebCore/workers/service/ServiceWorkerRegistration.h:132
> +    ListHashSet<Notification*> m_notificationList;

Can this use WeakPtr?
Comment 5 Brady Eidson 2022-02-15 09:51:46 PST
(In reply to Alex Christensen from comment #4)
> Comment on attachment 452032 [details]
> EWS v3
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=452032&action=review
> 
> > Source/WebCore/workers/service/ServiceWorkerRegistration.h:132
> > +    ListHashSet<Notification*> m_notificationList;
> 
> Can this use WeakPtr?

Yah that's probably better.
Comment 6 Brady Eidson 2022-02-15 10:34:39 PST
(In reply to Brady Eidson from comment #5)
> (In reply to Alex Christensen from comment #4)
> > Comment on attachment 452032 [details]
> > EWS v3
> > 
> > View in context:
> > https://bugs.webkit.org/attachment.cgi?id=452032&action=review
> > 
> > > Source/WebCore/workers/service/ServiceWorkerRegistration.h:132
> > > +    ListHashSet<Notification*> m_notificationList;
> > 
> > Can this use WeakPtr?
> 
> Yah that's probably better.

But also can't work - Can't use WeakPtr<> as a HashKey for obvious reasons.
Comment 7 Brady Eidson 2022-02-15 11:55:05 PST
Created attachment 452071 [details]
PFR
Comment 8 Alex Christensen 2022-02-15 12:04:53 PST
Comment on attachment 452071 [details]
PFR

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

> Source/WebCore/Modules/notifications/Notification.cpp:88
> +Notification::Notification(const Notification& other)

After calling the copy constructor, do we not need to call addNotificationToList?
Comment 9 Brady Eidson 2022-02-15 12:08:05 PST
(In reply to Alex Christensen from comment #8)
> Comment on attachment 452071 [details]
> PFR
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=452071&action=review
> 
> > Source/WebCore/Modules/notifications/Notification.cpp:88
> > +Notification::Notification(const Notification& other)
> 
> After calling the copy constructor, do we not need to call
> addNotificationToList?

We definitely *DON'T* want the copies to be in the list.

They don't represent a live notification object the same way the ones in the list do.
Comment 10 EWS 2022-02-15 17:26:37 PST
Committed r289866 (247306@main): <https://commits.webkit.org/247306@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 452071 [details].
Comment 11 Radar WebKit Bug Importer 2022-02-15 17:27:18 PST
<rdar://problem/88997342>