Bug 214907

Summary: REGRESSION(r264476): Calling systemHasAC() regresses launch time performance
Product: WebKit Reporter: Jer Noble <jer.noble>
Component: New BugsAssignee: Jer Noble <jer.noble>
Status: RESOLVED FIXED    
Severity: Normal CC: andersca, dewei_zhu, eric.carlson, sam, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch none

Description Jer Noble 2020-07-28 19:28:06 PDT
REGRESSION(r264476): Calling systemHasAC() regresses launch time performance
Comment 1 Jer Noble 2020-07-28 19:28:39 PDT
<rdar://problem/66191430>
Comment 2 Jer Noble 2020-07-28 19:33:28 PDT
Created attachment 405434 [details]
Patch
Comment 3 Eric Carlson 2020-07-29 09:38:51 PDT
Comment on attachment 405434 [details]
Patch

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

> Source/WebCore/platform/cocoa/PowerSourceNotifier.mm:44
>      if (status == NOTIFY_STATUS_OK)
>          m_tokenID = token;

If notify_register_dispatch failed, should this just return early instead of potentially calling notifyPowerSourceChanged()?
Comment 4 Jer Noble 2020-07-29 14:19:02 PDT
(In reply to Eric Carlson from comment #3)
> Comment on attachment 405434 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=405434&action=review
> 
> > Source/WebCore/platform/cocoa/PowerSourceNotifier.mm:44
> >      if (status == NOTIFY_STATUS_OK)
> >          m_tokenID = token;
> 
> If notify_register_dispatch failed, should this just return early instead of
> potentially calling notifyPowerSourceChanged()?

I don't think so. Even if the register command fails, we'll still want to update the AC state next run loop.
Comment 5 EWS 2020-07-29 14:22:48 PDT
Committed r265056: <https://trac.webkit.org/changeset/265056>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 405434 [details].