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

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

Issue 2833523002: Adding opt out and previews type information to DRP pingback (Closed)
Patch Set: moved definition up Created 3 years, 8 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 <string> 8 #include <string>
9 9
10 #include "base/macros.h" 10 #include "base/macros.h"
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after
193 193
194 // PageLoadMetadata for child frames of the current page load. 194 // PageLoadMetadata for child frames of the current page load.
195 const PageLoadMetadata child_frame_metadata; 195 const PageLoadMetadata child_frame_metadata;
196 }; 196 };
197 197
198 // Container for various information about a request within a page load. 198 // Container for various information about a request within a page load.
199 struct ExtraRequestInfo { 199 struct ExtraRequestInfo {
200 ExtraRequestInfo(bool was_cached, 200 ExtraRequestInfo(bool was_cached,
201 int64_t raw_body_bytes, 201 int64_t raw_body_bytes,
202 bool data_reduction_proxy_used, 202 bool data_reduction_proxy_used,
203 bool was_lofi_response,
203 int64_t original_network_content_length); 204 int64_t original_network_content_length);
204 205
205 ExtraRequestInfo(const ExtraRequestInfo& other); 206 ExtraRequestInfo(const ExtraRequestInfo& other);
206 207
207 ~ExtraRequestInfo(); 208 ~ExtraRequestInfo();
208 209
209 // True if the resource was loaded from cache. 210 // True if the resource was loaded from cache.
210 const bool was_cached; 211 const bool was_cached;
211 212
212 // The number of body (not header) prefilter bytes. 213 // The number of body (not header) prefilter bytes.
213 const int64_t raw_body_bytes; 214 const int64_t raw_body_bytes;
214 215
215 // Whether this request used Data Reduction Proxy. 216 // Whether this request used Data Reduction Proxy.
216 const bool data_reduction_proxy_used; 217 const bool data_reduction_proxy_used;
217 218
219 // Whether this request was a Data Reduction Proxy LoFi response.
220 const bool was_lofi_response;
221
218 // The number of body (not header) bytes that the data reduction proxy saw 222 // The number of body (not header) bytes that the data reduction proxy saw
219 // before it compressed the requests. 223 // before it compressed the requests.
220 const int64_t original_network_content_length; 224 const int64_t original_network_content_length;
221 }; 225 };
222 226
223 // Interface for PageLoadMetrics observers. All instances of this class are 227 // Interface for PageLoadMetrics observers. All instances of this class are
224 // owned by the PageLoadTracker tracking a page load. 228 // owned by the PageLoadTracker tracking a page load.
225 class PageLoadMetricsObserver { 229 class PageLoadMetricsObserver {
226 public: 230 public:
227 // ObservePolicy is used as a return value on some PageLoadMetricsObserver 231 // ObservePolicy is used as a return value on some PageLoadMetricsObserver
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after
375 const FailedProvisionalLoadInfo& failed_provisional_load_info, 379 const FailedProvisionalLoadInfo& failed_provisional_load_info,
376 const PageLoadExtraInfo& extra_info) {} 380 const PageLoadExtraInfo& extra_info) {}
377 381
378 // Called whenever a request is loaded for this page load. 382 // Called whenever a request is loaded for this page load.
379 virtual void OnLoadedResource(const ExtraRequestInfo& extra_request_info) {} 383 virtual void OnLoadedResource(const ExtraRequestInfo& extra_request_info) {}
380 }; 384 };
381 385
382 } // namespace page_load_metrics 386 } // namespace page_load_metrics
383 387
384 #endif // CHROME_BROWSER_PAGE_LOAD_METRICS_PAGE_LOAD_METRICS_OBSERVER_H_ 388 #endif // CHROME_BROWSER_PAGE_LOAD_METRICS_PAGE_LOAD_METRICS_OBSERVER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698