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

Issue 2593073002: base::Time should correctly handle -epoch time values from Javascript (Closed)

Created:
4 years ago by majidvp
Modified:
3 years, 11 months ago
Reviewers:
miu
CC:
chromium-reviews, vmpstr+watch_chromium.org, tkent
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Correctly handle -epoch time values when converting from JS time to base::Time -11644473600 seconds (which represents windows epoch time of |1601-01-01 00:00:00 UTC|) is a valid time value in Javascript. Incidentally this value is internally represented by 0 which is mistakenly confused with a null time value. FromJsTime is meant to be used to convert time values coming from Javascript for which 0 or -epoch do not represent null values. So the extra check was incorrect. * In fact there is a comment in FromJsTime method making it clear that 0 is a valid value but this was missed in ToJsTime method. TEST=./base_unittests --gtest_filter=TimeTest.JsTime BUG=625680 Committed: https://crrev.com/6650abf280f2987af809b0111ad00e5dba5723e4 Cr-Commit-Position: refs/heads/master@{#440304}

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+9 lines, -4 lines) Patch
M base/time/time.cc View 1 chunk +0 lines, -4 lines 0 comments Download
M base/time/time_unittest.cc View 1 chunk +9 lines, -0 lines 0 comments Download

Messages

Total messages: 20 (11 generated)
majidvp
miu@ PTAL This was brought to my attention by tkent@ in blink-dev: https://groups.google.com/a/chromium.org/d/msg/blink-dev/2c3sDVonZ3A/itnzRQl1DgAJ
4 years ago (2016-12-21 16:59:47 UTC) #3
miu
lgtm
4 years ago (2016-12-22 01:01:45 UTC) #10
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2593073002/1
4 years ago (2016-12-22 01:02:43 UTC) #11
commit-bot: I haz the power
Committed patchset #1 (id:1)
4 years ago (2016-12-22 01:37:08 UTC) #14
commit-bot: I haz the power
Patchset 1 (id:??) landed as https://crrev.com/6650abf280f2987af809b0111ad00e5dba5723e4 Cr-Commit-Position: refs/heads/master@{#440304}
4 years ago (2016-12-22 01:39:35 UTC) #16
xhwang
On 2016/12/22 01:39:35, commit-bot: I haz the power wrote: > Patchset 1 (id:??) landed as ...
3 years, 11 months ago (2017-01-21 05:40:22 UTC) #17
xhwang
On 2017/01/21 05:40:22, xhwang_slow wrote: > On 2016/12/22 01:39:35, commit-bot: I haz the power wrote: ...
3 years, 11 months ago (2017-01-21 05:47:53 UTC) #18
xhwang
On 2017/01/21 05:47:53, xhwang_slow wrote: > On 2017/01/21 05:40:22, xhwang_slow wrote: > > On 2016/12/22 ...
3 years, 11 months ago (2017-01-21 05:49:18 UTC) #19
majidvp
3 years, 11 months ago (2017-01-26 15:07:42 UTC) #20
Message was sent while issue was closed.
A revert of this CL (patchset #1 id:1) has been created in
https://codereview.chromium.org/2655233003/ by majidvp@chromium.org.

The reason for reverting is: The patched broke EME player which was relying on
null time being converted to 0 in FromJsTime.

After discussing this, we agreed to try to change all conversion methods
together to ensure consistency. A precursor to doing this will be to get stop
treating zero as null.


For more info see: 
https://bugs.chromium.org/p/chromium/issues/detail?id=679079#c13.

Powered by Google App Engine
This is Rietveld 408576698