summaryrefslogtreecommitdiffstats
path: root/webkit/blob/blob_data.cc
diff options
context:
space:
mode:
Diffstat (limited to 'webkit/blob/blob_data.cc')
-rw-r--r--webkit/blob/blob_data.cc12
1 files changed, 11 insertions, 1 deletions
diff --git a/webkit/blob/blob_data.cc b/webkit/blob/blob_data.cc
index 838014b..4afcf8a 100644
--- a/webkit/blob/blob_data.cc
+++ b/webkit/blob/blob_data.cc
@@ -15,6 +15,16 @@ using WebKit::WebBlobData;
using WebKit::WebData;
using WebKit::WebString;
+namespace {
+
+// Time::FromDoubleT() does not return empty Time object when dt is 0.
+// We have to work around this problem here.
+base::Time DoubleTToTime(double dt) {
+ return dt ? base::Time::FromDoubleT(dt) : base::Time();
+}
+
+}
+
namespace webkit_blob {
BlobData::BlobData(const WebBlobData& data) {
@@ -34,7 +44,7 @@ BlobData::BlobData(const WebBlobData& data) {
webkit_glue::WebStringToFilePath(item.filePath),
static_cast<uint64>(item.offset),
static_cast<uint64>(item.length),
- base::Time::FromDoubleT(item.expectedModificationTime));
+ DoubleTToTime(item.expectedModificationTime));
break;
case WebBlobData::Item::TypeBlob:
if (item.length) {