Index: ppapi/shared_impl/time_conversion.cc |
diff --git a/ppapi/shared_impl/time_conversion.cc b/ppapi/shared_impl/time_conversion.cc |
index 53d7b99de03b02726c4a28a8c7e2b5de82ff14fd..07ca6f73a2c5269661bf6be5f6acae13dd3ee5ea 100644 |
--- a/ppapi/shared_impl/time_conversion.cc |
+++ b/ppapi/shared_impl/time_conversion.cc |
@@ -30,6 +30,12 @@ PP_Time TimeToPPTime(base::Time t) { |
} |
base::Time PPTimeToTime(PP_Time t) { |
+ // The time code handles exact "0" values as special, and produces |
+ // a "null" Time object. But calling code would expect t==0 to represent the |
+ // epoch (according to the description of PP_Time). Hence we just return the |
+ // epoch in this case. |
+ if (t == 0.0) |
+ return base::Time::UnixEpoch(); |
return base::Time::FromDoubleT(t); |
} |