| 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 CHROME_BROWSER_PAGE_LOAD_METRICS_PAGE_LOAD_METRICS_OBSERVER_H_ | 5 #ifndef CHROME_BROWSER_PAGE_LOAD_METRICS_PAGE_LOAD_METRICS_OBSERVER_H_ |
| 6 #define CHROME_BROWSER_PAGE_LOAD_METRICS_PAGE_LOAD_METRICS_OBSERVER_H_ | 6 #define CHROME_BROWSER_PAGE_LOAD_METRICS_PAGE_LOAD_METRICS_OBSERVER_H_ |
| 7 | 7 |
| 8 #include "base/macros.h" | 8 #include "base/macros.h" |
| 9 #include "base/optional.h" | 9 #include "base/optional.h" |
| 10 #include "chrome/common/page_load_metrics/page_load_timing.h" | 10 #include "chrome/common/page_load_metrics/page_load_timing.h" |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 60 net::Error error; | 60 net::Error error; |
| 61 }; | 61 }; |
| 62 | 62 |
| 63 struct PageLoadExtraInfo { | 63 struct PageLoadExtraInfo { |
| 64 PageLoadExtraInfo( | 64 PageLoadExtraInfo( |
| 65 const base::Optional<base::TimeDelta>& first_background_time, | 65 const base::Optional<base::TimeDelta>& first_background_time, |
| 66 const base::Optional<base::TimeDelta>& first_foreground_time, | 66 const base::Optional<base::TimeDelta>& first_foreground_time, |
| 67 bool started_in_foreground, | 67 bool started_in_foreground, |
| 68 bool user_gesture, | 68 bool user_gesture, |
| 69 const GURL& committed_url, | 69 const GURL& committed_url, |
| 70 const GURL& start_url, |
| 70 const base::Optional<base::TimeDelta>& time_to_commit, | 71 const base::Optional<base::TimeDelta>& time_to_commit, |
| 71 UserAbortType abort_type, | 72 UserAbortType abort_type, |
| 72 bool abort_user_initiated, | 73 bool abort_user_initiated, |
| 73 const base::Optional<base::TimeDelta>& time_to_abort, | 74 const base::Optional<base::TimeDelta>& time_to_abort, |
| 74 int num_cache_requests, | 75 int num_cache_requests, |
| 75 int num_network_requests, | 76 int num_network_requests, |
| 76 const PageLoadMetadata& metadata); | 77 const PageLoadMetadata& metadata); |
| 77 | 78 |
| 78 PageLoadExtraInfo(const PageLoadExtraInfo& other); | 79 PageLoadExtraInfo(const PageLoadExtraInfo& other); |
| 79 | 80 |
| 80 ~PageLoadExtraInfo(); | 81 ~PageLoadExtraInfo(); |
| 81 | 82 |
| 82 // The first time that the page was backgrounded since the navigation started. | 83 // The first time that the page was backgrounded since the navigation started. |
| 83 const base::Optional<base::TimeDelta> first_background_time; | 84 const base::Optional<base::TimeDelta> first_background_time; |
| 84 | 85 |
| 85 // The first time that the page was foregrounded since the navigation started. | 86 // The first time that the page was foregrounded since the navigation started. |
| 86 const base::Optional<base::TimeDelta> first_foreground_time; | 87 const base::Optional<base::TimeDelta> first_foreground_time; |
| 87 | 88 |
| 88 // True if the page load started in the foreground. | 89 // True if the page load started in the foreground. |
| 89 const bool started_in_foreground; | 90 const bool started_in_foreground; |
| 90 | 91 |
| 91 // True if this is either a browser initiated navigation or the user_gesture | 92 // True if this is either a browser initiated navigation or the user_gesture |
| 92 // bit is true in the renderer. | 93 // bit is true in the renderer. |
| 93 const bool user_gesture; | 94 const bool user_gesture; |
| 94 | 95 |
| 95 // Committed URL. If the page load did not commit, |committed_url| will be | 96 // Committed URL. If the page load did not commit, |committed_url| will be |
| 96 // empty. | 97 // empty. |
| 97 const GURL committed_url; | 98 const GURL committed_url; |
| 98 | 99 |
| 100 // The URL that started the navigation, before redirects. |
| 101 const GURL start_url; |
| 102 |
| 99 // Time from navigation start until commit. | 103 // Time from navigation start until commit. |
| 100 const base::Optional<base::TimeDelta> time_to_commit; | 104 const base::Optional<base::TimeDelta> time_to_commit; |
| 101 | 105 |
| 102 // The abort time and time to abort for this page load. If the page was not | 106 // The abort time and time to abort for this page load. If the page was not |
| 103 // aborted, |abort_type| will be |ABORT_NONE|. | 107 // aborted, |abort_type| will be |ABORT_NONE|. |
| 104 const UserAbortType abort_type; | 108 const UserAbortType abort_type; |
| 105 | 109 |
| 106 // TODO(csharrison): If more metadata for aborts is needed we should provide a | 110 // TODO(csharrison): If more metadata for aborts is needed we should provide a |
| 107 // better abstraction. Note that this is an approximation. | 111 // better abstraction. Note that this is an approximation. |
| 108 bool abort_user_initiated; | 112 bool abort_user_initiated; |
| (...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 225 // loads that result in downloads or 204s are aborted by the system, and are | 229 // loads that result in downloads or 204s are aborted by the system, and are |
| 226 // also included as failed provisional loads. | 230 // also included as failed provisional loads. |
| 227 virtual void OnFailedProvisionalLoad( | 231 virtual void OnFailedProvisionalLoad( |
| 228 const FailedProvisionalLoadInfo& failed_provisional_load_info, | 232 const FailedProvisionalLoadInfo& failed_provisional_load_info, |
| 229 const PageLoadExtraInfo& extra_info) {} | 233 const PageLoadExtraInfo& extra_info) {} |
| 230 }; | 234 }; |
| 231 | 235 |
| 232 } // namespace page_load_metrics | 236 } // namespace page_load_metrics |
| 233 | 237 |
| 234 #endif // CHROME_BROWSER_PAGE_LOAD_METRICS_PAGE_LOAD_METRICS_OBSERVER_H_ | 238 #endif // CHROME_BROWSER_PAGE_LOAD_METRICS_PAGE_LOAD_METRICS_OBSERVER_H_ |
| OLD | NEW |