Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1361)

Issue 182613002: Add support to Battery Status API in blink. (Closed)

Created:
6 years, 9 months ago by Srini
Modified:
6 years, 9 months ago
CC:
blink-reviews
Base URL:
https://chromium.googlesource.com/chromium/blink.git@master
Visibility:
Public.

Description

Add support to Battery Status API in blink. This patch adds basic Battery Manager to Navigator with default battery status values and the test enables to test if those values are passed correctly. Intent-to-Implement link: https://groups.google.com/a/chromium.org/forum/#!msg/blink-dev/fzoG6Phr09k/dnAEzkgMA1YJ BUG=122593 Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=168632

Patch Set 1 #

Total comments: 5

Patch Set 2 : Updated patch with review comments fixed. #

Patch Set 3 : Add to RunTimeEnabledFeatures #

Total comments: 18

Patch Set 4 : Removed ActiveDOMWindow and added ContextLifeCycleObserver and other minor fixes. #

Total comments: 3

Patch Set 5 : More cleanups and removed override method. #

Patch Set 6 : Rebase the patch #

Patch Set 7 : Change Frame.h to LocalFrame.h #

Patch Set 8 : Rebase results of fast/dom/navigator-detached-no-crash.html test. #

Patch Set 9 : Rebase results for 4 failing patches #

Patch Set 10 : Revert additional changes in the previous commit #

Patch Set 11 : Add NeedsRebaseline for 4 tests for Mac. #

Total comments: 10
Unified diffs Side-by-side diffs Delta from patch set Stats (+377 lines, -2 lines) Patch
M LayoutTests/TestExpectations View 1 2 3 4 5 6 7 8 9 10 1 chunk +4 lines, -0 lines 0 comments Download
A LayoutTests/battery-status/test-battery-status-basic.html View 1 2 3 4 1 chunk +20 lines, -0 lines 0 comments Download
A LayoutTests/battery-status/test-battery-status-basic-expected.txt View 1 chunk +9 lines, -0 lines 0 comments Download
M LayoutTests/fast/dom/Window/property-access-on-cached-properties-after-frame-navigated-expected.txt View 1 2 3 4 5 6 7 8 9 1 chunk +4 lines, -0 lines 0 comments Download
M LayoutTests/fast/dom/Window/property-access-on-cached-properties-after-frame-removed-expected.txt View 1 2 3 4 5 6 7 8 9 1 chunk +4 lines, -0 lines 0 comments Download
M LayoutTests/fast/dom/Window/property-access-on-cached-window-after-frame-navigated-expected.txt View 1 2 3 4 5 6 7 8 9 1 chunk +4 lines, -0 lines 0 comments Download
M LayoutTests/fast/dom/Window/property-access-on-cached-window-after-frame-removed-expected.txt View 1 2 3 4 5 6 7 8 9 1 chunk +4 lines, -0 lines 0 comments Download
M LayoutTests/fast/dom/Window/resources/window-property-collector.js View 1 2 3 4 5 6 7 8 1 chunk +12 lines, -0 lines 0 comments Download
M LayoutTests/fast/dom/navigator-detached-no-crash-expected.txt View 1 2 3 4 5 6 7 2 chunks +2 lines, -0 lines 0 comments Download
M Source/core/events/EventTargetFactory.in View 1 chunk +1 line, -0 lines 0 comments Download
A Source/modules/battery/BatteryManager.h View 1 2 3 4 1 chunk +59 lines, -0 lines 9 comments Download
A Source/modules/battery/BatteryManager.cpp View 1 2 3 4 1 chunk +64 lines, -0 lines 0 comments Download
A Source/modules/battery/BatteryManager.idl View 1 2 3 1 chunk +21 lines, -0 lines 0 comments Download
A Source/modules/battery/BatteryStatus.h View 1 1 chunk +36 lines, -0 lines 0 comments Download
A Source/modules/battery/BatteryStatus.cpp View 1 1 chunk +39 lines, -0 lines 0 comments Download
A Source/modules/battery/NavigatorBattery.h View 1 2 3 1 chunk +34 lines, -0 lines 1 comment Download
A Source/modules/battery/NavigatorBattery.cpp View 1 2 3 4 5 6 1 chunk +48 lines, -0 lines 0 comments Download
A + Source/modules/battery/NavigatorBattery.idl View 1 2 1 chunk +3 lines, -2 lines 0 comments Download
M Source/modules/modules.gypi View 1 2 3 4 5 3 chunks +8 lines, -0 lines 0 comments Download
M Source/platform/RuntimeEnabledFeatures.in View 1 2 3 4 5 1 chunk +1 line, -0 lines 0 comments Download

Messages

Total messages: 75 (0 generated)
Srini
Hi, Can you review this patch. It breaks down the earlier patch and just submitting ...
6 years, 9 months ago (2014-02-27 05:01:25 UTC) #1
abarth-chromium
Thanks for breaking this CL up into smaller pieces. This API appears to provide synchronous ...
6 years, 9 months ago (2014-02-27 05:42:08 UTC) #2
Srini
On 2014/02/27 05:42:08, abarth wrote: > Thanks for breaking this CL up into smaller pieces. ...
6 years, 9 months ago (2014-02-27 06:42:30 UTC) #3
abarth-chromium
On 2014/02/27 06:42:30, Srini wrote: > The navigator.battery has a default value. The battery manager ...
6 years, 9 months ago (2014-02-27 06:49:35 UTC) #4
Srini
On 2014/02/27 06:49:35, abarth wrote: > On 2014/02/27 06:42:30, Srini wrote: > > The navigator.battery ...
6 years, 9 months ago (2014-02-27 07:42:17 UTC) #5
abarth-chromium
On 2014/02/27 07:42:17, Srini wrote: > I kept this to be in sync with the ...
6 years, 9 months ago (2014-02-27 07:44:16 UTC) #6
Srini
On 2014/02/27 07:44:16, abarth wrote: > On 2014/02/27 07:42:17, Srini wrote: > > I kept ...
6 years, 9 months ago (2014-02-27 07:53:41 UTC) #7
abarth-chromium
On 2014/02/27 07:53:41, Srini wrote: > Sorry, I couldn't understand. Do you mean that I ...
6 years, 9 months ago (2014-02-27 07:57:37 UTC) #8
Srini
On 2014/02/27 07:57:37, abarth wrote: > On 2014/02/27 07:53:41, Srini wrote: > > Sorry, I ...
6 years, 9 months ago (2014-02-27 08:00:05 UTC) #9
Srini
I just fixed the review comments except, 'subclassing ActiveDOMObject' as this is needed in the ...
6 years, 9 months ago (2014-02-27 08:48:00 UTC) #10
Srini
On 2014/02/27 08:48:00, Srini wrote: > I just fixed the review comments except, 'subclassing ActiveDOMObject' ...
6 years, 9 months ago (2014-02-27 19:24:42 UTC) #11
jam
removing myself as a reviewer (i'm not in any blink owners files)
6 years, 9 months ago (2014-02-27 21:56:10 UTC) #12
abarth-chromium
https://codereview.chromium.org/182613002/diff/40001/LayoutTests/battery-status/test-battery-status-basic.html File LayoutTests/battery-status/test-battery-status-basic.html (right): https://codereview.chromium.org/182613002/diff/40001/LayoutTests/battery-status/test-battery-status-basic.html#newcode18 LayoutTests/battery-status/test-battery-status-basic.html:18: document.getElementById("p4").innerHTML = "Percentage: " + battery.level*100; Can you clean ...
6 years, 9 months ago (2014-02-28 06:45:14 UTC) #13
Srini
Just fixed all the comments you mentioned. Hopefully I didn't miss any. Thanks!
6 years, 9 months ago (2014-02-28 11:26:32 UTC) #14
Srini
On 2014/02/28 11:26:32, Srini wrote: > Just fixed all the comments you mentioned. Hopefully I ...
6 years, 9 months ago (2014-03-04 03:17:57 UTC) #15
abarth-chromium
This is close. Just a couple more nits. https://codereview.chromium.org/182613002/diff/60001/LayoutTests/battery-status/test-battery-status-basic.html File LayoutTests/battery-status/test-battery-status-basic.html (right): https://codereview.chromium.org/182613002/diff/60001/LayoutTests/battery-status/test-battery-status-basic.html#newcode18 LayoutTests/battery-status/test-battery-status-basic.html:18: document.getElementById("p4").innerHTML ...
6 years, 9 months ago (2014-03-04 06:42:11 UTC) #16
abarth-chromium
LGTM assuming the nits above are addressed.
6 years, 9 months ago (2014-03-04 06:42:29 UTC) #17
Srini
The CQ bit was checked by srinivasa.ragavan.venkateswaran@intel.com
6 years, 9 months ago (2014-03-04 07:42:30 UTC) #18
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/srinivasa.ragavan.venkateswaran@intel.com/182613002/80001
6 years, 9 months ago (2014-03-04 07:42:47 UTC) #19
commit-bot: I haz the power
The CQ bit was unchecked by commit-bot@chromium.org
6 years, 9 months ago (2014-03-04 07:42:52 UTC) #20
commit-bot: I haz the power
Failed to apply patch for Source/modules/modules.gypi: While running patch -p1 --forward --force --no-backup-if-mismatch; patching file ...
6 years, 9 months ago (2014-03-04 07:42:53 UTC) #21
Srini
The CQ bit was checked by srinivasa.ragavan.venkateswaran@intel.com
6 years, 9 months ago (2014-03-04 08:48:36 UTC) #22
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/srinivasa.ragavan.venkateswaran@intel.com/182613002/100001
6 years, 9 months ago (2014-03-04 08:48:51 UTC) #23
Srini
The CQ bit was checked by srinivasa.ragavan.venkateswaran@intel.com
6 years, 9 months ago (2014-03-04 09:12:20 UTC) #24
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/srinivasa.ragavan.venkateswaran@intel.com/182613002/120001
6 years, 9 months ago (2014-03-04 09:12:54 UTC) #25
commit-bot: I haz the power
The CQ bit was unchecked by commit-bot@chromium.org
6 years, 9 months ago (2014-03-04 11:26:17 UTC) #26
commit-bot: I haz the power
Retried try job too often on mac_blink_rel for step(s) webkit_tests http://build.chromium.org/p/tryserver.chromium/buildstatus?builder=mac_blink_rel&number=20830
6 years, 9 months ago (2014-03-04 11:26:18 UTC) #27
Srini
The CQ bit was checked by srinivasa.ragavan.venkateswaran@intel.com
6 years, 9 months ago (2014-03-04 12:54:55 UTC) #28
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/srinivasa.ragavan.venkateswaran@intel.com/182613002/120001
6 years, 9 months ago (2014-03-04 12:55:01 UTC) #29
Srini
On 2014/03/04 12:55:01, I haz the power (commit-bot) wrote: > CQ is trying da patch. ...
6 years, 9 months ago (2014-03-04 14:24:04 UTC) #30
commit-bot: I haz the power
The CQ bit was unchecked by commit-bot@chromium.org
6 years, 9 months ago (2014-03-04 14:52:08 UTC) #31
commit-bot: I haz the power
Retried try job too often on mac_blink_rel for step(s) webkit_tests http://build.chromium.org/p/tryserver.chromium/buildstatus?builder=mac_blink_rel&number=20845
6 years, 9 months ago (2014-03-04 14:52:09 UTC) #32
Srini
On 2014/03/04 14:52:09, I haz the power (commit-bot) wrote: > Retried try job too often ...
6 years, 9 months ago (2014-03-04 16:06:58 UTC) #33
Srini
The CQ bit was checked by srinivasa.ragavan.venkateswaran@intel.com
6 years, 9 months ago (2014-03-04 16:24:38 UTC) #34
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/srinivasa.ragavan.venkateswaran@intel.com/182613002/140001
6 years, 9 months ago (2014-03-04 16:24:53 UTC) #35
commit-bot: I haz the power
The CQ bit was unchecked by commit-bot@chromium.org
6 years, 9 months ago (2014-03-04 18:21:27 UTC) #36
commit-bot: I haz the power
Retried try job too often on mac_blink_rel for step(s) webkit_tests http://build.chromium.org/p/tryserver.chromium/buildstatus?builder=mac_blink_rel&number=20878
6 years, 9 months ago (2014-03-04 18:21:27 UTC) #37
abarth-chromium
The CQ bit was checked by abarth@chromium.org
6 years, 9 months ago (2014-03-04 19:04:18 UTC) #38
abarth-chromium
On 2014/03/04 16:06:58, Srini wrote: > Just wondering if Im overlooking something or is it ...
6 years, 9 months ago (2014-03-04 19:04:46 UTC) #39
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/srinivasa.ragavan.venkateswaran@intel.com/182613002/140001
6 years, 9 months ago (2014-03-04 19:05:49 UTC) #40
commit-bot: I haz the power
The CQ bit was unchecked by commit-bot@chromium.org
6 years, 9 months ago (2014-03-04 20:58:56 UTC) #41
commit-bot: I haz the power
Retried try job too often on mac_blink_rel for step(s) webkit_tests http://build.chromium.org/p/tryserver.chromium/buildstatus?builder=mac_blink_rel&number=20906
6 years, 9 months ago (2014-03-04 20:58:57 UTC) #42
Srini
The CQ bit was checked by srinivasa.ragavan.venkateswaran@intel.com
6 years, 9 months ago (2014-03-05 03:09:45 UTC) #43
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/srinivasa.ragavan.venkateswaran@intel.com/182613002/140001
6 years, 9 months ago (2014-03-05 03:10:33 UTC) #44
commit-bot: I haz the power
The CQ bit was unchecked by commit-bot@chromium.org
6 years, 9 months ago (2014-03-05 05:54:04 UTC) #45
commit-bot: I haz the power
Retried try job too often on mac_blink_rel for step(s) webkit_tests http://build.chromium.org/p/tryserver.chromium/buildstatus?builder=mac_blink_rel&number=21026
6 years, 9 months ago (2014-03-05 05:54:05 UTC) #46
Srini
The CQ bit was checked by srinivasa.ragavan.venkateswaran@intel.com
6 years, 9 months ago (2014-03-05 14:18:55 UTC) #47
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/srinivasa.ragavan.venkateswaran@intel.com/182613002/140001
6 years, 9 months ago (2014-03-05 14:19:10 UTC) #48
commit-bot: I haz the power
The CQ bit was unchecked by commit-bot@chromium.org
6 years, 9 months ago (2014-03-05 16:04:04 UTC) #49
commit-bot: I haz the power
Retried try job too often on linux_blink_rel for step(s) webkit_tests http://build.chromium.org/p/tryserver.chromium/buildstatus?builder=linux_blink_rel&number=24168
6 years, 9 months ago (2014-03-05 16:04:05 UTC) #50
Srini
The CQ bit was checked by srinivasa.ragavan.venkateswaran@intel.com
6 years, 9 months ago (2014-03-06 03:46:40 UTC) #51
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/srinivasa.ragavan.venkateswaran@intel.com/182613002/140001
6 years, 9 months ago (2014-03-06 03:47:13 UTC) #52
commit-bot: I haz the power
The CQ bit was unchecked by commit-bot@chromium.org
6 years, 9 months ago (2014-03-06 04:11:48 UTC) #53
commit-bot: I haz the power
Try jobs failed on following builders: linux_blink_rel
6 years, 9 months ago (2014-03-06 04:11:49 UTC) #54
Srini
The CQ bit was checked by srinivasa.ragavan.venkateswaran@intel.com
6 years, 9 months ago (2014-03-06 06:13:27 UTC) #55
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/srinivasa.ragavan.venkateswaran@intel.com/182613002/140001
6 years, 9 months ago (2014-03-06 06:13:42 UTC) #56
commit-bot: I haz the power
The CQ bit was unchecked by commit-bot@chromium.org
6 years, 9 months ago (2014-03-06 06:52:35 UTC) #57
commit-bot: I haz the power
Try jobs failed on following builders: mac_blink_rel
6 years, 9 months ago (2014-03-06 06:52:35 UTC) #58
Srini
The CQ bit was checked by srinivasa.ragavan.venkateswaran@intel.com
6 years, 9 months ago (2014-03-06 10:51:21 UTC) #59
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/srinivasa.ragavan.venkateswaran@intel.com/182613002/170001
6 years, 9 months ago (2014-03-06 10:51:33 UTC) #60
commit-bot: I haz the power
The CQ bit was unchecked by commit-bot@chromium.org
6 years, 9 months ago (2014-03-06 10:52:41 UTC) #61
commit-bot: I haz the power
Try jobs failed on following builders: mac_blink_compile
6 years, 9 months ago (2014-03-06 10:52:41 UTC) #62
Srini
The CQ bit was checked by srinivasa.ragavan.venkateswaran@intel.com
6 years, 9 months ago (2014-03-06 11:01:06 UTC) #63
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/srinivasa.ragavan.venkateswaran@intel.com/182613002/170001
6 years, 9 months ago (2014-03-06 11:01:18 UTC) #64
commit-bot: I haz the power
The CQ bit was unchecked by commit-bot@chromium.org
6 years, 9 months ago (2014-03-06 11:07:05 UTC) #65
commit-bot: I haz the power
Try jobs failed on following builders: linux_blink
6 years, 9 months ago (2014-03-06 11:07:06 UTC) #66
Srini
The CQ bit was checked by srinivasa.ragavan.venkateswaran@intel.com
6 years, 9 months ago (2014-03-06 11:27:49 UTC) #67
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/srinivasa.ragavan.venkateswaran@intel.com/182613002/170001
6 years, 9 months ago (2014-03-06 11:27:57 UTC) #68
commit-bot: I haz the power
The CQ bit was unchecked by commit-bot@chromium.org
6 years, 9 months ago (2014-03-06 11:39:25 UTC) #69
commit-bot: I haz the power
Try jobs failed on following builders: mac_blink_rel
6 years, 9 months ago (2014-03-06 11:39:27 UTC) #70
Srini
The CQ bit was checked by srinivasa.ragavan.venkateswaran@intel.com
6 years, 9 months ago (2014-03-06 12:03:31 UTC) #71
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/srinivasa.ragavan.venkateswaran@intel.com/182613002/190001
6 years, 9 months ago (2014-03-06 12:03:46 UTC) #72
commit-bot: I haz the power
Change committed as 168632
6 years, 9 months ago (2014-03-06 12:58:18 UTC) #73
Inactive
Sorry for being late. I think the code can be simplified a little bit. https://codereview.chromium.org/182613002/diff/190001/Source/modules/battery/BatteryManager.h ...
6 years, 9 months ago (2014-03-06 13:45:38 UTC) #74
Srini
6 years, 9 months ago (2014-03-06 13:50:32 UTC) #75
Message was sent while issue was closed.
On 2014/03/06 13:45:38, Chris Dumez wrote:
> Sorry for being late. I think the code can be simplified a little bit.

Heya btw!. I'll fix this and submit as a new CL in a bit.

Thanks,
-Srini.

> 
>
https://codereview.chromium.org/182613002/diff/190001/Source/modules/battery/...
> File Source/modules/battery/BatteryManager.h (right):
> 
>
https://codereview.chromium.org/182613002/diff/190001/Source/modules/battery/...
> Source/modules/battery/BatteryManager.h:17: class BatteryManager : public
> ContextLifecycleObserver, public RefCounted<BatteryManager>, public
EventTarget
> {
> I believe you can subclass EventTargetWithInlineData instead of EventTarget.
> 
> Also, if BatteryManager is not subclassed, it should be marked as FINAL.
> 
>
https://codereview.chromium.org/182613002/diff/190001/Source/modules/battery/...
> Source/modules/battery/BatteryManager.h:18: public:
> REFCOUNTED_EVENT_TARGET(BatteryManager);
> 
>
https://codereview.chromium.org/182613002/diff/190001/Source/modules/battery/...
> Source/modules/battery/BatteryManager.h:24: virtual ExecutionContext*
> executionContext() const OVERRIDE FINAL { return
> ContextLifecycleObserver::executionContext(); }
> Don't need the FINAL here if you mark the class as FINAL.
> 
>
https://codereview.chromium.org/182613002/diff/190001/Source/modules/battery/...
> Source/modules/battery/BatteryManager.h:38: using
> RefCounted<BatteryManager>::ref;
> Not needed if you use the macro I suggested.
> 
>
https://codereview.chromium.org/182613002/diff/190001/Source/modules/battery/...
> Source/modules/battery/BatteryManager.h:39: using
> RefCounted<BatteryManager>::deref;
> Not needed if you use the macro I suggested.
> 
>
https://codereview.chromium.org/182613002/diff/190001/Source/modules/battery/...
> Source/modules/battery/BatteryManager.h:42: virtual EventTargetData*
> eventTargetData() { return &m_eventTargetData; }
> Not needed if you subclass EventTargetWithInlineData.
> 
>
https://codereview.chromium.org/182613002/diff/190001/Source/modules/battery/...
> Source/modules/battery/BatteryManager.h:43: virtual EventTargetData&
> ensureEventTargetData() { return m_eventTargetData; }
> Not needed if you subclass EventTargetWithInlineData.
> 
>
https://codereview.chromium.org/182613002/diff/190001/Source/modules/battery/...
> Source/modules/battery/BatteryManager.h:48: // EventTarget implementation.
> Those 2 methods are not needed if you use the macro I suggested.
> 
>
https://codereview.chromium.org/182613002/diff/190001/Source/modules/battery/...
> Source/modules/battery/BatteryManager.h:52: EventTargetData m_eventTargetData;
> Not needed if you subclass EventTargetWithInlineData.
> 
>
https://codereview.chromium.org/182613002/diff/190001/Source/modules/battery/...
> File Source/modules/battery/NavigatorBattery.h (right):
> 
>
https://codereview.chromium.org/182613002/diff/190001/Source/modules/battery/...
> Source/modules/battery/NavigatorBattery.h:26: explicit NavigatorBattery();
> A bit odd to make this constructor explicit since it has no argument

Powered by Google App Engine
This is Rietveld 408576698