Summary: | [EFL] Change return value of battey level | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Kihong Kwon <kihong.kwon> | ||||||||||||
Component: | WebKit EFL | Assignee: | Nobody <webkit-unassigned> | ||||||||||||
Status: | RESOLVED FIXED | ||||||||||||||
Severity: | Normal | CC: | gyuyoung.kim, hausmann, lucas.de.marchi, rakuco, webkit.review.bot | ||||||||||||
Priority: | P2 | ||||||||||||||
Version: | 528+ (Nightly build) | ||||||||||||||
Hardware: | Unspecified | ||||||||||||||
OS: | Unspecified | ||||||||||||||
URL: | http://www.w3.org/TR/battery-status/#idl-def-BatteryManager | ||||||||||||||
Bug Depends on: | |||||||||||||||
Bug Blocks: | 92839 | ||||||||||||||
Attachments: |
|
Description
Kihong Kwon
2012-08-02 02:36:16 PDT
Created attachment 156027 [details]
Patch
Comment on attachment 156027 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=156027&action=review > Source/WebCore/platform/efl/BatteryProviderEfl.cpp:165 > levelChanged = true; > level = property->val.d; > > - WTF::RefPtr<BatteryStatus> batteryStatus = BatteryStatus::create(charging, chargingTime, dischargingTime, level); > + WTF::RefPtr<BatteryStatus> batteryStatus = BatteryStatus::create(charging, chargingTime, dischargingTime, level / 100); If then, should we compare with clientBatteryStatus->level() * 100 and property->val.d ? IMO, you'd better to assign property->val.d / 100 to `level` to reduce confusion. (In reply to comment #2) > (From update of attachment 156027 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=156027&action=review > > > Source/WebCore/platform/efl/BatteryProviderEfl.cpp:165 > > levelChanged = true; > > level = property->val.d; > > > > - WTF::RefPtr<BatteryStatus> batteryStatus = BatteryStatus::create(charging, chargingTime, dischargingTime, level); > > + WTF::RefPtr<BatteryStatus> batteryStatus = BatteryStatus::create(charging, chargingTime, dischargingTime, level / 100); > > If then, should we compare with clientBatteryStatus->level() * 100 and property->val.d ? > > IMO, you'd better to assign property->val.d / 100 to `level` to reduce confusion. You are right. It was my mistake. Created attachment 156032 [details]
Patch
Comment on attachment 156032 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=156032&action=review > Source/WebCore/platform/efl/BatteryProviderEfl.cpp:163 > - if (!clientBatteryStatus || clientBatteryStatus->level() != property->val.d) > + if (!clientBatteryStatus || clientBatteryStatus->level() != property->val.d / 100) > levelChanged = true; > - level = property->val.d; > + level = property->val.d / 100; I am not sure why you use level, local variable. IMO, you can remove level variable or assign it before 161 line with declaration. Created attachment 156037 [details]
Patch
Created attachment 156051 [details]
Patch
Comment on attachment 156051 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=156051&action=review > Source/WebCore/ChangeLog:11 > + No new tests, no behavior changed. I think that this comment is wrong. This patch changes behavior but we can not make automated tests for this because we can not emulate E_Ukit. > Source/WebCore/platform/efl/BatteryProviderEfl.cpp:155 > + double level = property->val.d / 100; I think that property of "Percentage" is not assigned yet. Created attachment 156053 [details]
Patch
Comment on attachment 156053 [details] Patch Clearing flags on attachment: 156053 Committed r124450: <http://trac.webkit.org/changeset/124450> All reviewed patches have been landed. Closing bug. |