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" |
| 11 #include "third_party/WebKit/public/web/WebInputEvent.h" | |
| 11 #include "url/gurl.h" | 12 #include "url/gurl.h" |
| 12 | 13 |
| 13 namespace page_load_metrics { | 14 namespace page_load_metrics { |
| 14 | 15 |
| 15 // This enum represents how a page load ends. If the action occurs before the | 16 // This enum represents how a page load ends. If the action occurs before the |
| 16 // page load finishes (or reaches some point like first paint), then we consider | 17 // page load finishes (or reaches some point like first paint), then we consider |
| 17 // the load to be aborted. | 18 // the load to be aborted. |
| 18 enum UserAbortType { | 19 enum UserAbortType { |
| 19 // Represents no abort. | 20 // Represents no abort. |
| 20 ABORT_NONE, | 21 ABORT_NONE, |
| (...skipping 23 matching lines...) Expand all Loading... | |
| 44 // navigation it was. | 45 // navigation it was. |
| 45 ABORT_UNKNOWN_NAVIGATION, | 46 ABORT_UNKNOWN_NAVIGATION, |
| 46 | 47 |
| 47 // Add values before this final count. | 48 // Add values before this final count. |
| 48 ABORT_LAST_ENTRY | 49 ABORT_LAST_ENTRY |
| 49 }; | 50 }; |
| 50 | 51 |
| 51 struct PageLoadExtraInfo { | 52 struct PageLoadExtraInfo { |
| 52 PageLoadExtraInfo(base::TimeDelta first_background_time, | 53 PageLoadExtraInfo(base::TimeDelta first_background_time, |
| 53 base::TimeDelta first_foreground_time, | 54 base::TimeDelta first_foreground_time, |
| 55 base::TimeDelta first_user_interaction_time, | |
| 54 bool started_in_foreground, | 56 bool started_in_foreground, |
| 55 const GURL& committed_url, | 57 const GURL& committed_url, |
| 56 base::TimeDelta time_to_commit, | 58 base::TimeDelta time_to_commit, |
| 57 UserAbortType abort_type, | 59 UserAbortType abort_type, |
| 58 base::TimeDelta time_to_abort, | 60 base::TimeDelta time_to_abort, |
| 59 const PageLoadMetadata& metadata); | 61 const PageLoadMetadata& metadata); |
| 60 PageLoadExtraInfo(const PageLoadExtraInfo& other); | 62 PageLoadExtraInfo(const PageLoadExtraInfo& other); |
| 61 | 63 |
| 62 // The first time that the page was backgrounded since the navigation started. | 64 // The first time that the page was backgrounded since the navigation started. |
| 63 // If the page has not been backgrounded this will be base::TimeDelta(). | 65 // If the page has not been backgrounded this will be base::TimeDelta(). |
| 64 const base::TimeDelta first_background_time; | 66 const base::TimeDelta first_background_time; |
| 65 | 67 |
| 66 // The first time that the page was foregrounded since the navigation started. | 68 // The first time that the page was foregrounded since the navigation started. |
| 67 // If the page has not been foregrounded this will be base::TimeDelta(). | 69 // If the page has not been foregrounded this will be base::TimeDelta(). |
| 68 const base::TimeDelta first_foreground_time; | 70 const base::TimeDelta first_foreground_time; |
| 69 | 71 |
| 72 // The first time that the page was given a user input since the navigation | |
| 73 // started. | |
| 74 const base::TimeDelta first_user_interaction_time; | |
|
Bryan McQuade
2016/05/18 15:21:50
i'm actually not sure if this is a generally usefu
| |
| 75 | |
| 70 // True if the page load started in the foreground. | 76 // True if the page load started in the foreground. |
| 71 const bool started_in_foreground; | 77 const bool started_in_foreground; |
| 72 | 78 |
| 73 // Committed URL. If the page load did not commit, |committed_url| will be | 79 // Committed URL. If the page load did not commit, |committed_url| will be |
| 74 // empty. | 80 // empty. |
| 75 const GURL committed_url; | 81 const GURL committed_url; |
| 76 | 82 |
| 77 // Time from navigation start until commit. If the page load did not commit, | 83 // Time from navigation start until commit. If the page load did not commit, |
| 78 // |time_to_commit| will be zero. | 84 // |time_to_commit| will be zero. |
| 79 const base::TimeDelta time_to_commit; | 85 const base::TimeDelta time_to_commit; |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 157 virtual void OnFirstTextPaint(const PageLoadTiming& timing, | 163 virtual void OnFirstTextPaint(const PageLoadTiming& timing, |
| 158 const PageLoadExtraInfo& extra_info) {} | 164 const PageLoadExtraInfo& extra_info) {} |
| 159 virtual void OnFirstImagePaint(const PageLoadTiming& timing, | 165 virtual void OnFirstImagePaint(const PageLoadTiming& timing, |
| 160 const PageLoadExtraInfo& extra_info) {} | 166 const PageLoadExtraInfo& extra_info) {} |
| 161 virtual void OnFirstContentfulPaint(const PageLoadTiming& timing, | 167 virtual void OnFirstContentfulPaint(const PageLoadTiming& timing, |
| 162 const PageLoadExtraInfo& extra_info) {} | 168 const PageLoadExtraInfo& extra_info) {} |
| 163 virtual void OnParseStart(const PageLoadTiming& timing, | 169 virtual void OnParseStart(const PageLoadTiming& timing, |
| 164 const PageLoadExtraInfo& extra_info) {} | 170 const PageLoadExtraInfo& extra_info) {} |
| 165 virtual void OnParseStop(const PageLoadTiming& timing, | 171 virtual void OnParseStop(const PageLoadTiming& timing, |
| 166 const PageLoadExtraInfo& extra_info) {} | 172 const PageLoadExtraInfo& extra_info) {} |
| 173 | |
| 174 // OnUserInteraction is triggered when a new user input is passed in to | |
| 175 // web_contents | |
|
tdresser
2016/05/17 13:24:53
nit:missing period.
tdresser
2016/05/17 13:24:53
It worries me a bit that these comments don't make
Bryan McQuade
2016/05/18 15:21:50
yeah, i agree - it seems the WCO hook we are overr
| |
| 176 virtual void OnUserInteraction(blink::WebInputEvent::Type type) {} | |
| 167 }; | 177 }; |
| 168 | 178 |
| 169 } // namespace page_load_metrics | 179 } // namespace page_load_metrics |
| 170 | 180 |
| 171 #endif // COMPONENTS_PAGE_LOAD_METRICS_BROWSER_PAGE_LOAD_METRICS_OBSERVER_H_ | 181 #endif // COMPONENTS_PAGE_LOAD_METRICS_BROWSER_PAGE_LOAD_METRICS_OBSERVER_H_ |
| OLD | NEW |