From 615b40c6a98d3abf076e6157ee8acf8857248618 Mon Sep 17 00:00:00 2001 From: "tim@chromium.org" Date: Tue, 31 Aug 2010 23:56:06 +0000 Subject: Revert 58093 as an experiment to fix the Cookies test on linux. Remove the workaround that is not needed after the fix for Time::FromDoubleT is landed. BUG=none TEST=none Review URL: http://codereview.chromium.org/3270016 TBR=jianli@chromium.org Review URL: http://codereview.chromium.org/3287010 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@58102 0039d316-1c4b-4281-b951-d872f2087c98 --- webkit/blob/blob_data.cc | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'webkit/blob') 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(item.offset), static_cast(item.length), - base::Time::FromDoubleT(item.expectedModificationTime)); + DoubleTToTime(item.expectedModificationTime)); break; case WebBlobData::Item::TypeBlob: if (item.length) { -- cgit v1.1