There is a distinct difference between a TimeDelta being zero and unset, but consumers of DataReductionProxyPageLoadTiming consider is_zero() to mean the value was not set.
See related CL: https://codereview.chromium.org/2111073003/
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/4aaa1c3f03e522bb84b99e6bdf36a9b334865547 commit 4aaa1c3f03e522bb84b99e6bdf36a9b334865547 Author: ryansturm <ryansturm@chromium.org> Date: Wed Jul 13 20:35:23 2016 Changing the TimeDeltas in DRPPageLoadTiming to Optional To match the TimeDeltas in page_load_metrics, the DataReductionProxyPageLoadTiming TimeDeltas are changed to base::Optional TimeDeltas. Functionally, this will only change the case where the TimeDelta is zero. The constructor for DataReductionProxyPageLoadTiming is moved to a new cc file due to the templated variables creating a complex constructor. BUG= 626040 Review-Url: https://codereview.chromium.org/2145743002 Cr-Commit-Position: refs/heads/master@{#405279} [modify] https://crrev.com/4aaa1c3f03e522bb84b99e6bdf36a9b334865547/chrome/browser/page_load_metrics/observers/data_reduction_proxy_metrics_observer.cc [modify] https://crrev.com/4aaa1c3f03e522bb84b99e6bdf36a9b334865547/chrome/browser/page_load_metrics/observers/data_reduction_proxy_metrics_observer_unittest.cc [modify] https://crrev.com/4aaa1c3f03e522bb84b99e6bdf36a9b334865547/components/data_reduction_proxy.gypi [modify] https://crrev.com/4aaa1c3f03e522bb84b99e6bdf36a9b334865547/components/data_reduction_proxy/core/browser/data_reduction_proxy_pingback_client.cc [modify] https://crrev.com/4aaa1c3f03e522bb84b99e6bdf36a9b334865547/components/data_reduction_proxy/core/browser/data_reduction_proxy_pingback_client_unittest.cc [modify] https://crrev.com/4aaa1c3f03e522bb84b99e6bdf36a9b334865547/components/data_reduction_proxy/core/common/BUILD.gn [add] https://crrev.com/4aaa1c3f03e522bb84b99e6bdf36a9b334865547/components/data_reduction_proxy/core/common/data_reduction_proxy_page_load_timing.cc [modify] https://crrev.com/4aaa1c3f03e522bb84b99e6bdf36a9b334865547/components/data_reduction_proxy/core/common/data_reduction_proxy_page_load_timing.h
Comment 1 by ryansturm@chromium.org
, Jul 6 2016