Chromium Code Reviews
Help | Chromium Project | Gerrit Changes | Sign in
(47)

Issue 976373002: Return same promise consistently when using navigator.getBattery() (Closed)

Created:
5 years, 1 month ago by timvolodine
Modified:
4 years, 10 months ago
CC:
blink-reviews, mlamouri+watch-blink_chromium.org, timvolodine
Base URL:
https://chromium.googlesource.com/chromium/blink.git@master
Target Ref:
refs/heads/master
Project:
blink
Visibility:
Public.

Description

Return same promise consistently when using navigator.getBattery() Use ScriptPromiseProperty to return same battery manager promise every time, even when it has already been resolved. This is in line with the specification. It also simplifies the code logic a bit since there is no need to keep an enum for the state of the battery manager. BUG=385025 Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=197048

Patch Set 1 #

Total comments: 6

Patch Set 2 : fix comments #

Total comments: 2

Patch Set 3 : rebase, make compile, fix comment #

Unified diffs Side-by-side diffs Delta from patch set Stats (+34 lines, -40 lines) Patch
M LayoutTests/battery-status/multiple-promises.html View 3 chunks +5 lines, -3 lines 0 comments Download
M LayoutTests/battery-status/multiple-promises-after-resolve.html View 2 chunks +6 lines, -2 lines 0 comments Download
M LayoutTests/battery-status/multiple-promises-after-resolve-expected.txt View 1 chunk +1 line, -0 lines 0 comments Download
M LayoutTests/battery-status/multiple-promises-expected.txt View 1 chunk +1 line, -1 line 0 comments Download
M Source/modules/battery/BatteryManager.h View 1 2 2 chunks +4 lines, -9 lines 0 comments Download
M Source/modules/battery/BatteryManager.cpp View 1 2 4 chunks +17 lines, -25 lines 0 comments Download

Messages

Total messages: 10 (3 generated)
timvolodine
Mounir would you be able to take a look?
5 years, 1 month ago (2015-03-05 17:09:14 UTC) #2
mlamouri (slow - plz ping)
Very nice patch! :) Could you have a look at the comments below? https://codereview.chromium.org/976373002/diff/1/Source/modules/battery/BatteryManager.cpp File ...
5 years, 1 month ago (2015-03-07 14:54:42 UTC) #3
timvolodine
thanks for the comments, ptal https://codereview.chromium.org/976373002/diff/1/Source/modules/battery/BatteryManager.cpp File Source/modules/battery/BatteryManager.cpp (right): https://codereview.chromium.org/976373002/diff/1/Source/modules/battery/BatteryManager.cpp#newcode83 Source/modules/battery/BatteryManager.cpp:83: if (!m_isResolved) { On ...
5 years, 1 month ago (2015-03-12 13:53:11 UTC) #4
mlamouri (slow - plz ping)
lgtm with the comment below addressed Thanks! :) https://codereview.chromium.org/976373002/diff/20001/Source/modules/battery/BatteryManager.cpp File Source/modules/battery/BatteryManager.cpp (right): https://codereview.chromium.org/976373002/diff/20001/Source/modules/battery/BatteryManager.cpp#newcode43 Source/modules/battery/BatteryManager.cpp:43: if ...
5 years, 1 month ago (2015-03-13 16:20:00 UTC) #5
timvolodine
revisiting this patch.. https://codereview.chromium.org/976373002/diff/20001/Source/modules/battery/BatteryManager.cpp File Source/modules/battery/BatteryManager.cpp (right): https://codereview.chromium.org/976373002/diff/20001/Source/modules/battery/BatteryManager.cpp#newcode43 Source/modules/battery/BatteryManager.cpp:43: if (m_batteryProperty->state() == ScriptPromisePropertyBase::Resolved || !executionContext() ...
4 years, 10 months ago (2015-06-12 17:29:04 UTC) #6
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/976373002/40001
4 years, 10 months ago (2015-06-12 17:29:32 UTC) #9
commit-bot: I haz the power
4 years, 10 months ago (2015-06-12 17:33:04 UTC) #10
Message was sent while issue was closed.
Committed patchset #3 (id:40001) as
https://src.chromium.org/viewvc/blink?view=rev&revision=197048

Powered by Google App Engine
This is Rietveld 408576698