WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
Bug 221996
[macOS] Observe system sleep events in the UI process
https://bugs.webkit.org/show_bug.cgi?id=221996
Summary
[macOS] Observe system sleep events in the UI process
Per Arne Vollan
Reported
2021-02-16 13:44:09 PST
System sleep events should be observed in the UI process, which should notify the WebContent process.
Attachments
Patch
(11.47 KB, patch)
2021-02-16 14:25 PST
,
Per Arne Vollan
no flags
Details
Formatted Diff
Diff
View All
Add attachment
proposed patch, testcase, etc.
Radar WebKit Bug Importer
Comment 1
2021-02-16 14:20:18 PST
<
rdar://problem/74406570
>
Per Arne Vollan
Comment 2
2021-02-16 14:25:54 PST
Created
attachment 420540
[details]
Patch
Brent Fulgham
Comment 3
2021-02-17 09:44:52 PST
Comment on
attachment 420540
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=420540&action=review
I'm worried this change is not right for iOS, since the MediaSessionManagerIOS class is a subclass of MediaSessionManager. I like the idea of the UIProcess handling sleep events, and forwarding them to the WebContent process -- I just think you might need these changes for iOS, too.
> Source/WebKit/UIProcess/WebProcessPool.h:132 > + , private PAL::SystemSleepListener::Client
MediaSessionManagerIOS *is a* MediaSessionManagerCocoa. Are you sure we don't need this code in the iOS case?
Per Arne Vollan
Comment 4
2021-02-17 09:49:29 PST
(In reply to Brent Fulgham from
comment #3
)
> Comment on
attachment 420540
[details]
> Patch > > View in context: >
https://bugs.webkit.org/attachment.cgi?id=420540&action=review
> > I'm worried this change is not right for iOS, since the > MediaSessionManagerIOS class is a subclass of MediaSessionManager. I like > the idea of the UIProcess handling sleep events, and forwarding them to the > WebContent process -- I just think you might need these changes for iOS, too. > > > Source/WebKit/UIProcess/WebProcessPool.h:132 > > + , private PAL::SystemSleepListener::Client > > MediaSessionManagerIOS *is a* MediaSessionManagerCocoa. Are you sure we > don't need this code in the iOS case?
Yes, I believe you are right. I will add it for iOS as well. Thanks for reviewing!
youenn fablet
Comment 5
2021-02-17 09:57:20 PST
Comment on
attachment 420540
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=420540&action=review
>> Source/WebKit/UIProcess/WebProcessPool.h:132 >> + , private PAL::SystemSleepListener::Client > > MediaSessionManagerIOS *is a* MediaSessionManagerCocoa. Are you sure we don't need this code in the iOS case?
I think this change is ok in practice, agreed it is a bit weird that this code is in Cocoa and not MediaSessionManagerMac, but we do not have any. I am not sure WebProcessPool is the best choice though. Maybe there should be a singleton that would be enabled at creation of WebProcessPool for instance and that would send it to all processes of all process pools. Another approach would be to do this in GPUProcess, since this is only used for media.
Peng Liu
Comment 6
2021-02-17 15:55:08 PST
***
Bug 222055
has been marked as a duplicate of this bug. ***
Chris Dumez
Comment 7
2021-02-17 17:15:52 PST
Comment on
attachment 420540
[details]
Patch r=me
Per Arne Vollan
Comment 8
2021-02-18 07:02:03 PST
(In reply to Per Arne Vollan from
comment #4
)
> (In reply to Brent Fulgham from
comment #3
) > > Comment on
attachment 420540
[details]
> > Patch > > > > View in context: > >
https://bugs.webkit.org/attachment.cgi?id=420540&action=review
> > > > I'm worried this change is not right for iOS, since the > > MediaSessionManagerIOS class is a subclass of MediaSessionManager. I like > > the idea of the UIProcess handling sleep events, and forwarding them to the > > WebContent process -- I just think you might need these changes for iOS, too. > > > > > Source/WebKit/UIProcess/WebProcessPool.h:132 > > > + , private PAL::SystemSleepListener::Client > > > > MediaSessionManagerIOS *is a* MediaSessionManagerCocoa. Are you sure we > > don't need this code in the iOS case? > > Yes, I believe you are right. I will add it for iOS as well. > > Thanks for reviewing!
Looking closer, it seems that the SystemSleepListener is only an empty implementation on iOS, so it does not seem like it is required.
Per Arne Vollan
Comment 9
2021-02-18 07:07:39 PST
(In reply to youenn fablet from
comment #5
)
> Comment on
attachment 420540
[details]
> Patch > > View in context: >
https://bugs.webkit.org/attachment.cgi?id=420540&action=review
> > >> Source/WebKit/UIProcess/WebProcessPool.h:132 > >> + , private PAL::SystemSleepListener::Client > > > > MediaSessionManagerIOS *is a* MediaSessionManagerCocoa. Are you sure we don't need this code in the iOS case? > > I think this change is ok in practice, agreed it is a bit weird that this > code is in Cocoa and not MediaSessionManagerMac, but we do not have any. > I am not sure WebProcessPool is the best choice though. > Maybe there should be a singleton that would be enabled at creation of > WebProcessPool for instance and that would send it to all processes of all > process pools. > > Another approach would be to do this in GPUProcess, since this is only used > for media.
These are very good points. In this case, it seems we only create MediaSessionManagerCocoa in the WP process, also with the GPU process enabled, so it seems to be sufficient to only forward these events to the WP process. We may need to forward these events to other WebKit process going forward, though. Thanks for reviewing!
Per Arne Vollan
Comment 10
2021-02-18 07:07:56 PST
(In reply to Chris Dumez from
comment #7
)
> Comment on
attachment 420540
[details]
> Patch > > r=me
Thanks for reviewing!
EWS
Comment 11
2021-02-18 10:18:37 PST
Committed
r273082
: <
https://commits.webkit.org/r273082
> All reviewed patches have been landed. Closing bug and clearing flags on
attachment 420540
[details]
.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug