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

Issue 559993004: Fix TimeRanges::nearest() to actually calculate nearest time. (Closed)

Created:
6 years, 3 months ago by DaleCurtis
Modified:
6 years, 3 months ago
CC:
blink-reviews, blink-reviews-html_chromium.org, philipj_slow, gasubic, fs, eric.carlson_apple.com, feature-media-reviews_chromium.org, dglazkov+blink, nessy, vcarbune.chromium
Base URL:
https://chromium.googlesource.com/chromium/blink.git@master
Project:
blink
Visibility:
Public.

Description

Fix TimeRanges::nearest() to actually calculate nearest time. The existing implementation instead couldn't decide if it wanted to calculate the nearest time or how close a given time was to a range. The new implementation follows the HTML spec for TimeRanges where nearest() returns a time within the range closest to the desired time. Equidistant matches are resolved by distance from the current time. BUG=412562 TEST=new unittest. Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=181859

Patch Set 1 #

Total comments: 2

Patch Set 2 : Comments. #

Total comments: 4

Patch Set 3 : Comments. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+43 lines, -11 lines) Patch
M Source/core/html/HTMLMediaElement.cpp View 1 1 chunk +1 line, -1 line 0 comments Download
M Source/core/html/TimeRanges.h View 1 2 1 chunk +1 line, -1 line 0 comments Download
M Source/core/html/TimeRanges.cpp View 1 2 1 chunk +21 lines, -9 lines 0 comments Download
M Source/core/html/TimeRangesTest.cpp View 1 1 chunk +20 lines, -0 lines 0 comments Download

Messages

Total messages: 9 (2 generated)
DaleCurtis
6 years, 3 months ago (2014-09-10 23:08:41 UTC) #2
philipj_slow
lgtm % nit https://codereview.chromium.org/559993004/diff/1/Source/core/html/TimeRangesTest.cpp File Source/core/html/TimeRangesTest.cpp (right): https://codereview.chromium.org/559993004/diff/1/Source/core/html/TimeRangesTest.cpp#newcode317 Source/core/html/TimeRangesTest.cpp:317: ASSERT_EQ(7, ranges->nearest(8, 6)); Can you also ...
6 years, 3 months ago (2014-09-11 11:08:02 UTC) #3
DaleCurtis
https://codereview.chromium.org/559993004/diff/1/Source/core/html/TimeRangesTest.cpp File Source/core/html/TimeRangesTest.cpp (right): https://codereview.chromium.org/559993004/diff/1/Source/core/html/TimeRangesTest.cpp#newcode317 Source/core/html/TimeRangesTest.cpp:317: ASSERT_EQ(7, ranges->nearest(8, 6)); On 2014/09/11 11:08:02, philipj wrote: > ...
6 years, 3 months ago (2014-09-11 19:34:10 UTC) #4
acolwell GONE FROM CHROMIUM
lgtm % nit https://codereview.chromium.org/559993004/diff/20001/Source/core/html/TimeRanges.cpp File Source/core/html/TimeRanges.cpp (right): https://codereview.chromium.org/559993004/diff/20001/Source/core/html/TimeRanges.cpp#newcode185 Source/core/html/TimeRanges.cpp:185: double TimeRanges::nearest(double time, double now) const ...
6 years, 3 months ago (2014-09-11 22:24:39 UTC) #5
DaleCurtis
https://codereview.chromium.org/559993004/diff/20001/Source/core/html/TimeRanges.cpp File Source/core/html/TimeRanges.cpp (right): https://codereview.chromium.org/559993004/diff/20001/Source/core/html/TimeRanges.cpp#newcode185 Source/core/html/TimeRanges.cpp:185: double TimeRanges::nearest(double time, double now) const On 2014/09/11 22:24:39, ...
6 years, 3 months ago (2014-09-11 22:40:01 UTC) #6
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patchset/559993004/40001
6 years, 3 months ago (2014-09-11 23:08:40 UTC) #8
commit-bot: I haz the power
6 years, 3 months ago (2014-09-12 00:09:54 UTC) #9
Message was sent while issue was closed.
Committed patchset #3 (id:40001) as 181859

Powered by Google App Engine
This is Rietveld 408576698