Bug 206373

Summary: [Cocoa] Broker access to the PowerManagement API
Product: WebKit Reporter: Per Arne Vollan <pvollan>
Component: WebKit Misc.Assignee: Per Arne Vollan <pvollan>
Status: RESOLVED FIXED    
Severity: Normal CC: bfulgham, commit-queue, darin, ggaren, sam, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Patch
none
Patch
none
Patch
darin: review+
Patch none

Per Arne Vollan
Reported 2020-01-16 14:16:03 PST
Power management calls should be performed in the UI process.
Attachments
Patch (16.82 KB, patch)
2020-01-16 14:37 PST, Per Arne Vollan
no flags
Patch (16.88 KB, patch)
2020-01-16 14:57 PST, Per Arne Vollan
no flags
Patch (24.02 KB, patch)
2020-01-17 11:25 PST, Per Arne Vollan
no flags
Patch (24.01 KB, patch)
2020-01-17 17:06 PST, Per Arne Vollan
darin: review+
Patch (24.03 KB, patch)
2020-01-22 14:38 PST, Per Arne Vollan
no flags
Per Arne Vollan
Comment 1 2020-01-16 14:16:21 PST
Per Arne Vollan
Comment 2 2020-01-16 14:37:58 PST
Per Arne Vollan
Comment 3 2020-01-16 14:57:36 PST
Sam Weinig
Comment 4 2020-01-16 21:07:14 PST
Comment on attachment 387964 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=387964&action=review > Source/WebCore/platform/graphics/avfoundation/objc/AVAssetTrackUtilities.h:40 > +WEBCORE_EXPORT void setSystemHasBattery(bool); > +WEBCORE_EXPORT bool systemHasBattery(); This does not seem like the right file for these. If they need to be exposed outside of the .mm file, please move them to a more appropriate place or create a new file for them.
Per Arne Vollan
Comment 5 2020-01-17 11:25:49 PST
Per Arne Vollan
Comment 6 2020-01-17 11:26:43 PST
(In reply to Sam Weinig from comment #4) > Comment on attachment 387964 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=387964&action=review > > > Source/WebCore/platform/graphics/avfoundation/objc/AVAssetTrackUtilities.h:40 > > +WEBCORE_EXPORT void setSystemHasBattery(bool); > > +WEBCORE_EXPORT bool systemHasBattery(); > > This does not seem like the right file for these. If they need to be exposed > outside of the .mm file, please move them to a more appropriate place or > create a new file for them. Good point! I have moved this to a new file in the new patch. Thanks for reviewing, Sam!
Per Arne Vollan
Comment 7 2020-01-17 17:06:11 PST
Darin Adler
Comment 8 2020-01-20 11:59:56 PST
Comment on attachment 388120 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=388120&action=review > Source/WebCore/platform/cocoa/PowerUtils.h:2 > +* Copyright (C) 2020 Apple Inc. All rights reserved. File naming: A file named "XXXUtils" is against WebKit coding style. Not sure if we wrote it down or not. I suggest the name SystemBattery.h/mm. But there are probably other good names to consider. The vague programmer word "utilities" should be avoided, even though this rule has not been followed consistently. Lets not make another header with a name like this. Even just "Power.h" might be OK. The abbreviation "utils" goes against our stance against unnecessary abbreviation.
Per Arne Vollan
Comment 9 2020-01-21 12:01:38 PST
(In reply to Darin Adler from comment #8) > Comment on attachment 388120 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=388120&action=review > > > Source/WebCore/platform/cocoa/PowerUtils.h:2 > > +* Copyright (C) 2020 Apple Inc. All rights reserved. > > File naming: A file named "XXXUtils" is against WebKit coding style. Not > sure if we wrote it down or not. > > I suggest the name SystemBattery.h/mm. But there are probably other good > names to consider. > > The vague programmer word "utilities" should be avoided, even though this > rule has not been followed consistently. Lets not make another header with a > name like this. Even just "Power.h" might be OK. > > The abbreviation "utils" goes against our stance against unnecessary > abbreviation. Thanks for reviewing! I will update the patch according to the comments :) I think I will go with SystemBattery.h/mm as you suggested.
Per Arne Vollan
Comment 10 2020-01-22 14:38:10 PST
WebKit Commit Bot
Comment 11 2020-01-23 12:10:53 PST
Comment on attachment 388471 [details] Patch Clearing flags on attachment: 388471 Committed r254995: <https://trac.webkit.org/changeset/254995>
Note You need to log in before you can comment on or make changes to this bug.