Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(185)

Side by Side Diff: chrome/browser/page_load_metrics/page_load_metrics_observer.h

Issue 2218583002: [page_load_metrics] Log cache warmth ratios at parse stop (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: thestig@ review Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 const GURL& committed_url, 68 const GURL& committed_url,
69 const base::Optional<base::TimeDelta>& time_to_commit, 69 const base::Optional<base::TimeDelta>& time_to_commit,
70 UserAbortType abort_type, 70 UserAbortType abort_type,
71 const base::Optional<base::TimeDelta>& time_to_abort, 71 const base::Optional<base::TimeDelta>& time_to_abort,
72 int num_cache_requests,
73 int num_network_requests,
72 const PageLoadMetadata& metadata); 74 const PageLoadMetadata& metadata);
73 75
74 PageLoadExtraInfo(const PageLoadExtraInfo& other); 76 PageLoadExtraInfo(const PageLoadExtraInfo& other);
75 77
76 ~PageLoadExtraInfo(); 78 ~PageLoadExtraInfo();
77 79
78 // The first time that the page was backgrounded since the navigation started. 80 // The first time that the page was backgrounded since the navigation started.
79 const base::Optional<base::TimeDelta> first_background_time; 81 const base::Optional<base::TimeDelta> first_background_time;
80 82
81 // The first time that the page was foregrounded since the navigation started. 83 // The first time that the page was foregrounded since the navigation started.
82 const base::Optional<base::TimeDelta> first_foreground_time; 84 const base::Optional<base::TimeDelta> first_foreground_time;
83 85
84 // True if the page load started in the foreground. 86 // True if the page load started in the foreground.
85 const bool started_in_foreground; 87 const bool started_in_foreground;
86 88
87 // Committed URL. If the page load did not commit, |committed_url| will be 89 // Committed URL. If the page load did not commit, |committed_url| will be
88 // empty. 90 // empty.
89 const GURL committed_url; 91 const GURL committed_url;
90 92
91 // Time from navigation start until commit. 93 // Time from navigation start until commit.
92 const base::Optional<base::TimeDelta> time_to_commit; 94 const base::Optional<base::TimeDelta> time_to_commit;
93 95
94 // The abort time and time to abort for this page load. If the page was not 96 // The abort time and time to abort for this page load. If the page was not
95 // aborted, |abort_type| will be |ABORT_NONE|. 97 // aborted, |abort_type| will be |ABORT_NONE|.
96 const UserAbortType abort_type; 98 const UserAbortType abort_type;
97 99
98 const base::Optional<base::TimeDelta> time_to_abort; 100 const base::Optional<base::TimeDelta> time_to_abort;
99 101
102 // Note: these are only approximations, based on WebContents attribution from
103 // ResourceRequestInfo objects while this is the currently committed load in
104 // the WebContents.
105 int num_cache_requests;
106 int num_network_requests;
107
100 // Extra information supplied to the page load metrics system from the 108 // Extra information supplied to the page load metrics system from the
101 // renderer. 109 // renderer.
102 const PageLoadMetadata metadata; 110 const PageLoadMetadata metadata;
103 }; 111 };
104 112
105 // Interface for PageLoadMetrics observers. All instances of this class are 113 // Interface for PageLoadMetrics observers. All instances of this class are
106 // owned by the PageLoadTracker tracking a page load. 114 // owned by the PageLoadTracker tracking a page load.
107 class PageLoadMetricsObserver { 115 class PageLoadMetricsObserver {
108 public: 116 public:
109 virtual ~PageLoadMetricsObserver() {} 117 virtual ~PageLoadMetricsObserver() {}
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
205 // loads that result in downloads or 204s are aborted by the system, and are 213 // loads that result in downloads or 204s are aborted by the system, and are
206 // also included as failed provisional loads. 214 // also included as failed provisional loads.
207 virtual void OnFailedProvisionalLoad( 215 virtual void OnFailedProvisionalLoad(
208 const FailedProvisionalLoadInfo& failed_provisional_load_info, 216 const FailedProvisionalLoadInfo& failed_provisional_load_info,
209 const PageLoadExtraInfo& extra_info) {} 217 const PageLoadExtraInfo& extra_info) {}
210 }; 218 };
211 219
212 } // namespace page_load_metrics 220 } // namespace page_load_metrics
213 221
214 #endif // CHROME_BROWSER_PAGE_LOAD_METRICS_PAGE_LOAD_METRICS_OBSERVER_H_ 222 #endif // CHROME_BROWSER_PAGE_LOAD_METRICS_PAGE_LOAD_METRICS_OBSERVER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698