RESOLVED FIXED 221258
Register for power notifications in the UI process
https://bugs.webkit.org/show_bug.cgi?id=221258
Summary Register for power notifications in the UI process
Per Arne Vollan
Reported 2021-02-02 07:23:34 PST
Power notifications should be registered for in the UI process instead of the WebContent process.
Attachments
Patch (20.21 KB, patch)
2021-02-02 07:36 PST, Per Arne Vollan
ews-feeder: commit-queue-
Patch (14.35 KB, patch)
2021-02-02 08:17 PST, Per Arne Vollan
ews-feeder: commit-queue-
Patch (15.40 KB, patch)
2021-02-02 09:18 PST, Per Arne Vollan
ews-feeder: commit-queue-
Patch (15.46 KB, patch)
2021-02-02 09:44 PST, Per Arne Vollan
no flags
Per Arne Vollan
Comment 1 2021-02-02 07:36:50 PST
Per Arne Vollan
Comment 2 2021-02-02 08:17:23 PST
Per Arne Vollan
Comment 3 2021-02-02 09:18:35 PST
Per Arne Vollan
Comment 4 2021-02-02 09:44:01 PST
Brent Fulgham
Comment 5 2021-02-02 09:44:36 PST
Comment on attachment 419009 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=419009&action=review It looks like tvOS is unhappy, too! > Source/WebKit/WebProcess/WebProcess.messages.in:199 > +#if PLATFORM(MAC) Is this needed for Catalyst? > Source/WebKit/WebProcess/cocoa/WebProcessCocoa.mm:636 > + MainThreadSharedTimer::shouldSetupPowerObserver() = false; It seems like we place the burden of knowing not to set the power observer on the various client processes. Maybe it would be better if it defaulted to false, and the main UIProcess initialization had to set it to true?
Brent Fulgham
Comment 6 2021-02-02 09:53:51 PST
Comment on attachment 419014 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=419014&action=review > Source/WebKit/WebProcess/cocoa/WebProcessCocoa.mm:636 > + MainThreadSharedTimer::shouldSetupPowerObserver() = false; This places the burden on all aux processes. How about if we make the default false, and require this be set to true in 'Source/WebKit/Shared/WebKit2Initialize.cpp:void InitializeWebKit2()' so that only the UIProcess has to set this value?
Per Arne Vollan
Comment 7 2021-02-02 11:33:58 PST
(In reply to Brent Fulgham from comment #5) > Comment on attachment 419009 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=419009&action=review > > It looks like tvOS is unhappy, too! > > > Source/WebKit/WebProcess/WebProcess.messages.in:199 > > +#if PLATFORM(MAC) > > Is this needed for Catalyst? > It seems only Mac is using the PowerObserver, so I do not think this is needed for Catalyst. > > Source/WebKit/WebProcess/cocoa/WebProcessCocoa.mm:636 > > + MainThreadSharedTimer::shouldSetupPowerObserver() = false; > > It seems like we place the burden of knowing not to set the power observer > on the various client processes. Maybe it would be better if it defaulted to > false, and the main UIProcess initialization had to set it to true? We only disable setup of the PowerObserver in the WebContent process. The WebContent process will be notified by the UI process about power events. For the other processes it will default to true, which gives the same behavior as before. I am perhaps not understanding your comment correctly, though. Does this address your comment? Thanks for reviewing!
Brent Fulgham
Comment 8 2021-02-02 11:39:53 PST
Comment on attachment 419009 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=419009&action=review >>> Source/WebKit/WebProcess/WebProcess.messages.in:199 >>> +#if PLATFORM(MAC) >> >> Is this needed for Catalyst? > > It seems only Mac is using the PowerObserver, so I do not think this is needed for Catalyst. Okay, good. >>> Source/WebKit/WebProcess/cocoa/WebProcessCocoa.mm:636 >>> + MainThreadSharedTimer::shouldSetupPowerObserver() = false; >> >> It seems like we place the burden of knowing not to set the power observer on the various client processes. Maybe it would be better if it defaulted to false, and the main UIProcess initialization had to set it to true? > > We only disable setup of the PowerObserver in the WebContent process. The WebContent process will be notified by the UI process about power events. For the other processes it will default to true, which gives the same behavior as before. I am perhaps not understanding your comment correctly, though. Does this address your comment? > > Thanks for reviewing! Oh, I didn't understand that. I thought we were blocking for all processes. In that case, I think your change makes sense.
Per Arne Vollan
Comment 9 2021-02-02 11:52:30 PST
Comment on attachment 419014 [details] Patch Thanks for reviewing!
EWS
Comment 10 2021-02-02 12:26:25 PST
commit-queue failed to commit attachment 419014 [details] to WebKit repository.
EWS
Comment 11 2021-02-02 15:15:47 PST
Committed r272241: <https://trac.webkit.org/changeset/272241> All reviewed patches have been landed. Closing bug and clearing flags on attachment 419014 [details].
Radar WebKit Bug Importer
Comment 12 2021-02-02 15:16:17 PST
Note You need to log in before you can comment on or make changes to this bug.