Chromium Code Reviews| Index: components/data_reduction_proxy/browser/data_reduction_proxy_metrics.cc |
| diff --git a/components/data_reduction_proxy/browser/data_reduction_proxy_metrics.cc b/components/data_reduction_proxy/browser/data_reduction_proxy_metrics.cc |
| index 7143f7c209f51362a20bf16032c80bfe5367839b..e15c9fe1b620e559d839de683b50e73652d5a5fc 100644 |
| --- a/components/data_reduction_proxy/browser/data_reduction_proxy_metrics.cc |
| +++ b/components/data_reduction_proxy/browser/data_reduction_proxy_metrics.cc |
| @@ -396,18 +396,15 @@ void UpdateContentLengthPrefsForDataReductionProxy( |
| int64 then_internal = prefs->GetInt64( |
| data_reduction_proxy::prefs::kDailyHttpContentLengthLastUpdateDate); |
| -#if defined(OS_WIN) |
| - base::Time then_midnight = base::Time::FromInternalValue(then_internal); |
| - base::Time midnight = |
| - base::Time::FromInternalValue( |
| - (now.ToInternalValue() / base::Time::kMicrosecondsPerDay) * |
| - base::Time::kMicrosecondsPerDay); |
| -#else |
| // Local midnight could have been shifted due to time zone change. |
| - base::Time then_midnight = |
| - base::Time::FromInternalValue(then_internal).LocalMidnight(); |
| + // If time is null then don't care if midnight will be wrong shifted due to |
| + // time zone change because it's still too much time ago. |
| + base::Time then_midnight; |
| + if (then_internal != 0) { |
|
bengr
2014/08/25 21:37:08
nit: We shouldn't use or assume anything about the
|
| + then_midnight = |
| + base::Time::FromInternalValue(then_internal).LocalMidnight(); |
| + } |
| base::Time midnight = now.LocalMidnight(); |
| -#endif |
| int days_since_last_update = (midnight - then_midnight).InDays(); |