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

Issue 2663493002: Revert of base::Time should correctly handle -epoch time values from Javascript (patchset #1 id:1 o… (Closed)

Created:
3 years, 10 months ago by xhwang
Modified:
3 years, 10 months ago
Reviewers:
majidvp, miu
CC:
chromium-reviews
Target Ref:
refs/pending/branch-heads/2987
Project:
chromium
Visibility:
Public.

Description

Revert of base::Time should correctly handle -epoch time values from Javascript (patchset #1 id:1 of https://codereview.chromium.org/2593073002/ ) Reason for revert: 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 Original issue's 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} TBR=miu@chromium.org,majidvp@chromium.org BUG=625680, 679079 Review-Url: https://codereview.chromium.org/2655233003 Cr-Commit-Position: refs/heads/master@{#446340} (cherry picked from commit 7ff9ceb9be03477632e2808268882889ff551185) Review-Url: https://codereview.chromium.org/2663493002 . Cr-Commit-Position: refs/branch-heads/2987@{#138} Cr-Branched-From: ad51088c0e8776e8dcd963dbe752c4035ba6dab6-refs/heads/master@{#444943} Committed: https://chromium.googlesource.com/chromium/src/+/2ccfd6f67407374d5a23fb98eab6b39d887a0291

Patch Set 1 #

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

Messages

Total messages: 2 (1 generated)
xhwang
3 years, 10 months ago (2017-01-27 08:31:42 UTC) #2
Message was sent while issue was closed.
Committed patchset #1 (id:1) manually as
2ccfd6f67407374d5a23fb98eab6b39d887a0291.

Powered by Google App Engine
This is Rietveld 408576698