Chromium Code Reviews| Index: components/page_load_metrics/browser/page_load_metrics_observer.h |
| diff --git a/components/page_load_metrics/browser/page_load_metrics_observer.h b/components/page_load_metrics/browser/page_load_metrics_observer.h |
| index c42f36d93ee467eab1375a7bad8abbb8b90a4441..8613dc796d74889581e9bf0b3fdccba006ad993d 100644 |
| --- a/components/page_load_metrics/browser/page_load_metrics_observer.h |
| +++ b/components/page_load_metrics/browser/page_load_metrics_observer.h |
| @@ -6,6 +6,7 @@ |
| #define COMPONENTS_PAGE_LOAD_METRICS_BROWSER_PAGE_LOAD_METRICS_OBSERVER_H_ |
| #include "base/macros.h" |
| +#include "base/optional.h" |
| #include "components/page_load_metrics/common/page_load_timing.h" |
| #include "content/public/browser/navigation_handle.h" |
| #include "url/gurl.h" |
| @@ -51,21 +52,21 @@ enum UserAbortType { |
| }; |
| struct PageLoadExtraInfo { |
| - PageLoadExtraInfo(base::TimeDelta first_background_time, |
| - base::TimeDelta first_foreground_time, |
| + PageLoadExtraInfo(base::Optional<base::TimeDelta> first_background_time, |
|
Bryan McQuade
2016/03/29 18:33:43
given that base::Optional is bigger than a pointer
shivanisha
2016/03/29 18:54:24
Makes sense. will do
|
| + base::Optional<base::TimeDelta> first_foreground_time, |
| bool started_in_foreground, |
| const GURL& committed_url, |
| - base::TimeDelta time_to_commit, |
| + base::Optional<base::TimeDelta> time_to_commit, |
| UserAbortType abort_type, |
| - base::TimeDelta time_to_abort); |
| + base::Optional<base::TimeDelta> time_to_abort); |
| + |
| + ~PageLoadExtraInfo(); |
| // The first time that the page was backgrounded since the navigation started. |
| - // If the page has not been backgrounded this will be base::TimeDelta(). |
| - const base::TimeDelta first_background_time; |
| + const base::Optional<base::TimeDelta> first_background_time; |
| // The first time that the page was foregrounded since the navigation started. |
| - // If the page has not been foregrounded this will be base::TimeDelta(). |
| - const base::TimeDelta first_foreground_time; |
| + const base::Optional<base::TimeDelta> first_foreground_time; |
| // True if the page load started in the foreground. |
| const bool started_in_foreground; |
| @@ -74,15 +75,13 @@ struct PageLoadExtraInfo { |
| // empty. |
| const GURL committed_url; |
| - // Time from navigation start until commit. If the page load did not commit, |
| - // |time_to_commit| will be zero. |
| - const base::TimeDelta time_to_commit; |
| + // Time from navigation start until commit. |
| + const base::Optional<base::TimeDelta> time_to_commit; |
| // The abort time and time to abort for this page load. If the page was not |
| - // aborted, |abort_type| will be |ABORT_NONE| and |time_to_abort| will be |
| - // |base::TimeDelta()|. |
| + // aborted, |abort_type| will be |ABORT_NONE| |
| const UserAbortType abort_type; |
| - const base::TimeDelta time_to_abort; |
| + const base::Optional<base::TimeDelta> time_to_abort; |
| }; |
| // Interface for PageLoadMetrics observers. All instances of this class are |