Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef COMPONENTS_PAGE_LOAD_METRICS_BROWSER_PAGE_LOAD_METRICS_OBSERVER_H_ | 5 #ifndef COMPONENTS_PAGE_LOAD_METRICS_BROWSER_PAGE_LOAD_METRICS_OBSERVER_H_ |
| 6 #define COMPONENTS_PAGE_LOAD_METRICS_BROWSER_PAGE_LOAD_METRICS_OBSERVER_H_ | 6 #define COMPONENTS_PAGE_LOAD_METRICS_BROWSER_PAGE_LOAD_METRICS_OBSERVER_H_ |
| 7 | 7 |
| 8 #include "base/macros.h" | 8 #include "base/macros.h" |
| 9 #include "components/page_load_metrics/common/page_load_timing.h" | 9 #include "components/page_load_metrics/common/page_load_timing.h" |
| 10 #include "content/public/browser/navigation_handle.h" | 10 #include "content/public/browser/navigation_handle.h" |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 46 ABORT_LAST_ENTRY | 46 ABORT_LAST_ENTRY |
| 47 }; | 47 }; |
| 48 | 48 |
| 49 struct PageLoadExtraInfo { | 49 struct PageLoadExtraInfo { |
| 50 PageLoadExtraInfo(const base::TimeDelta& first_background_time, | 50 PageLoadExtraInfo(const base::TimeDelta& first_background_time, |
| 51 const base::TimeDelta& first_foreground_time, | 51 const base::TimeDelta& first_foreground_time, |
| 52 bool started_in_foreground, | 52 bool started_in_foreground, |
| 53 const GURL& committed_url, | 53 const GURL& committed_url, |
| 54 const base::TimeDelta& time_to_commit, | 54 const base::TimeDelta& time_to_commit, |
| 55 UserAbortType abort_type, | 55 UserAbortType abort_type, |
| 56 const base::TimeDelta& time_to_abort); | 56 const base::TimeDelta& time_to_abort, |
| 57 bool is_using_lofi, | |
| 58 bool was_fetched_via_data_reduction_proxy); | |
|
bengr
2016/02/26 22:53:57
That's a mouthful. How about used_data_reduction_p
RyanSturm
2016/03/01 19:36:04
Done.
| |
| 57 | 59 |
| 58 // Returns the time to first background if the page load started in the | 60 // Returns the time to first background if the page load started in the |
| 59 // foreground. If the page has not been backgrounded, or the page started in | 61 // foreground. If the page has not been backgrounded, or the page started in |
| 60 // the background, this will be base::TimeDelta(). | 62 // the background, this will be base::TimeDelta(). |
| 61 const base::TimeDelta first_background_time; | 63 const base::TimeDelta first_background_time; |
| 62 | 64 |
| 63 // Returns the time to first foreground if the page load started in the | 65 // Returns the time to first foreground if the page load started in the |
| 64 // background. If the page has not been foregrounded, or the page started in | 66 // background. If the page has not been foregrounded, or the page started in |
| 65 // the foreground, this will be base::TimeDelta(). | 67 // the foreground, this will be base::TimeDelta(). |
| 66 const base::TimeDelta first_foreground_time; | 68 const base::TimeDelta first_foreground_time; |
| 67 | 69 |
| 68 // True if the page load started in the foreground. | 70 // True if the page load started in the foreground. |
| 69 const bool started_in_foreground; | 71 const bool started_in_foreground; |
| 70 | 72 |
| 71 // Committed URL. If the page load did not commit, |committed_url| will be | 73 // Committed URL. If the page load did not commit, |committed_url| will be |
| 72 // empty. | 74 // empty. |
| 73 const GURL committed_url; | 75 const GURL committed_url; |
| 74 | 76 |
| 75 // Time from navigation start until commit. If the page load did not commit, | 77 // Time from navigation start until commit. If the page load did not commit, |
| 76 // |time_to_commit| will be zero. | 78 // |time_to_commit| will be zero. |
| 77 const base::TimeDelta time_to_commit; | 79 const base::TimeDelta time_to_commit; |
| 78 | 80 |
| 79 // The abort time and time to abort for this page load. If the page was not | 81 // The abort time and time to abort for this page load. If the page was not |
| 80 // aborted, |abort_type| will be |ABORT_NONE| and |time_to_abort| will be | 82 // aborted, |abort_type| will be |ABORT_NONE| and |time_to_abort| will be |
| 81 // |base::TimeDelta()|. | 83 // |base::TimeDelta()|. |
| 82 const UserAbortType abort_type; | 84 const UserAbortType abort_type; |
| 83 const base::TimeDelta time_to_abort; | 85 const base::TimeDelta time_to_abort; |
| 86 | |
| 87 bool is_using_lofi; | |
|
bengr
2016/02/26 22:53:57
Add comments to describe these.
RyanSturm
2016/03/01 19:36:04
Done.
| |
| 88 bool was_fetched_via_data_reduction_proxy; | |
| 84 }; | 89 }; |
| 85 | 90 |
| 86 // Interface for PageLoadMetrics observers. All instances of this class are | 91 // Interface for PageLoadMetrics observers. All instances of this class are |
| 87 // owned by the PageLoadTracker tracking a page load. They will be deleted after | 92 // owned by the PageLoadTracker tracking a page load. They will be deleted after |
| 88 // calling OnComplete. | 93 // calling OnComplete. |
| 89 class PageLoadMetricsObserver { | 94 class PageLoadMetricsObserver { |
| 90 public: | 95 public: |
| 91 virtual ~PageLoadMetricsObserver() {} | 96 virtual ~PageLoadMetricsObserver() {} |
| 92 | 97 |
| 93 // The page load started, with the given navigation handle. | 98 // The page load started, with the given navigation handle. |
| (...skipping 24 matching lines...) Expand all Loading... | |
| 118 // data collected over the course of the page load. If the load did not | 123 // data collected over the course of the page load. If the load did not |
| 119 // receive any timing information, |timing.IsEmpty()| will be true. | 124 // receive any timing information, |timing.IsEmpty()| will be true. |
| 120 // After this call, the object will be deleted. | 125 // After this call, the object will be deleted. |
| 121 virtual void OnComplete(const PageLoadTiming& timing, | 126 virtual void OnComplete(const PageLoadTiming& timing, |
| 122 const PageLoadExtraInfo& extra_info) {} | 127 const PageLoadExtraInfo& extra_info) {} |
| 123 }; | 128 }; |
| 124 | 129 |
| 125 } // namespace page_load_metrics | 130 } // namespace page_load_metrics |
| 126 | 131 |
| 127 #endif // COMPONENTS_PAGE_LOAD_METRICS_BROWSER_PAGE_LOAD_METRICS_OBSERVER_H_ | 132 #endif // COMPONENTS_PAGE_LOAD_METRICS_BROWSER_PAGE_LOAD_METRICS_OBSERVER_H_ |
| OLD | NEW |