From dc0e90e4058b77c7feaea1bfbe61c689df076127 Mon Sep 17 00:00:00 2001 From: "brettw@chromium.org" Date: Fri, 22 Apr 2011 16:01:32 +0000 Subject: Merge 82652 - Work around the special-case handling of 0 time values (see comment).TEST=manualBUG=noneReview URL: http://codereview.chromium.org/6894023 TBR=brettw@chromium.org BUG=80176 Review URL: http://codereview.chromium.org/6896019 git-svn-id: svn://svn.chromium.org/chrome/branches/742/src@82658 0039d316-1c4b-4281-b951-d872f2087c98 --- webkit/plugins/ppapi/ppb_flash_impl.cc | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'webkit/plugins') diff --git a/webkit/plugins/ppapi/ppb_flash_impl.cc b/webkit/plugins/ppapi/ppb_flash_impl.cc index 8599d9c..d54a46c 100644 --- a/webkit/plugins/ppapi/ppb_flash_impl.cc +++ b/webkit/plugins/ppapi/ppb_flash_impl.cc @@ -78,6 +78,14 @@ double GetLocalTimeZoneOffset(PP_Instance pp_instance, PP_Time t) { if (!instance) return 0.0; + // Evil hack. The time code handles exact "0" values as special, and produces + // a "null" Time object. This will represent some date hundreds of years ago + // and will give us funny results at 1970 (there are some tests where this + // comes up, but it shouldn't happen in real life). To work around this + // special handling, we just need to give it some nonzero value. + if (t == 0.0) + t = 0.0000000001; + // We can't do the conversion here because on Linux, the localtime calls // require filesystem access prohibited by the sandbox. return instance->delegate()->GetLocalTimeZoneOffset( -- cgit v1.1