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

Issue 2656843003: Do not expose is_null API for time values in Blink (Closed)

Created:
3 years, 10 months ago by majidvp
Modified:
3 years, 10 months ago
Reviewers:
esprehn
CC:
blink-reviews, blink-reviews-wtf_chromium.org, chromium-reviews, dtapuska+blinkwatch_chromium.org, Mikhail, Navid Zolghadr
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Do not expose is_null API for time values in Blink base::Time and base::TimeTicks interfaces expose a is_null() method. Unfortunately in current implementation is_null() == is_zero() which means that it is possible to write code that produces valid zero time but is confused with null time. So depending on this API can lead to brittle and buggy code. There is also a desire to eventually get rid of |is_null()| in base/ interface. Given above we shouldn't depend on this behavior in Blink. Any code that needs to have a "null" or "invalid" time value can use WTF::Optional<WTF::Time> instead which is more readable and explicit. BUG=625680 Review-Url: https://codereview.chromium.org/2656843003 Cr-Commit-Position: refs/heads/master@{#448023} Committed: https://chromium.googlesource.com/chromium/src/+/a0651393fc46e6637ac0a5bc29c816c3f4ee9088

Patch Set 1 #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+11 lines, -12 lines) Patch
M third_party/WebKit/Source/core/input/EventHandler.cpp View 1 chunk +5 lines, -6 lines 2 comments Download
M third_party/WebKit/Source/core/input/GestureManager.h View 3 chunks +3 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/core/input/GestureManager.cpp View 2 chunks +3 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/wtf/Time.h View 1 chunk +0 lines, -2 lines 0 comments Download

Messages

Total messages: 16 (10 generated)
majidvp
3 years, 10 months ago (2017-01-25 18:41:29 UTC) #6
majidvp
3 years, 10 months ago (2017-01-25 18:41:54 UTC) #8
esprehn
lgtm https://codereview.chromium.org/2656843003/diff/1/third_party/WebKit/Source/core/input/EventHandler.cpp File third_party/WebKit/Source/core/input/EventHandler.cpp (right): https://codereview.chromium.org/2656843003/diff/1/third_party/WebKit/Source/core/input/EventHandler.cpp#newcode1667 third_party/WebKit/Source/core/input/EventHandler.cpp:1667: m_gestureManager->getLastShowPressTimestamp()) { getLastShowPressTimestamp() I suppose is cheap enough ...
3 years, 10 months ago (2017-02-01 05:25:20 UTC) #10
majidvp
https://codereview.chromium.org/2656843003/diff/1/third_party/WebKit/Source/core/input/EventHandler.cpp File third_party/WebKit/Source/core/input/EventHandler.cpp (right): https://codereview.chromium.org/2656843003/diff/1/third_party/WebKit/Source/core/input/EventHandler.cpp#newcode1667 third_party/WebKit/Source/core/input/EventHandler.cpp:1667: m_gestureManager->getLastShowPressTimestamp()) { On 2017/02/01 05:25:20, esprehn wrote: > getLastShowPressTimestamp() ...
3 years, 10 months ago (2017-02-03 15:42:27 UTC) #11
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/2656843003/1
3 years, 10 months ago (2017-02-03 15:42:48 UTC) #13
commit-bot: I haz the power
3 years, 10 months ago (2017-02-03 18:07:16 UTC) #16
Message was sent while issue was closed.
Committed patchset #1 (id:1) as
https://chromium.googlesource.com/chromium/src/+/a0651393fc46e6637ac0a5bc29c8...

Powered by Google App Engine
This is Rietveld 408576698