DescriptionDo 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
Messages
Total messages: 16 (10 generated)
|