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

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

Issue 2833523002: Adding opt out and previews type information to DRP pingback (Closed)
Patch Set: bengr comments 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 #include "chrome/browser/page_load_metrics/page_load_metrics_observer.h" 5 #include "chrome/browser/page_load_metrics/page_load_metrics_observer.h"
6 6
7 #include <utility>
8
7 namespace page_load_metrics { 9 namespace page_load_metrics {
8 10
9 PageLoadExtraInfo::PageLoadExtraInfo( 11 PageLoadExtraInfo::PageLoadExtraInfo(
10 base::TimeTicks navigation_start, 12 base::TimeTicks navigation_start,
11 const base::Optional<base::TimeDelta>& first_background_time, 13 const base::Optional<base::TimeDelta>& first_background_time,
12 const base::Optional<base::TimeDelta>& first_foreground_time, 14 const base::Optional<base::TimeDelta>& first_foreground_time,
13 bool started_in_foreground, 15 bool started_in_foreground,
14 UserInitiatedInfo user_initiated_info, 16 UserInitiatedInfo user_initiated_info,
15 const GURL& url, 17 const GURL& url,
16 const GURL& start_url, 18 const GURL& start_url,
(...skipping 30 matching lines...) Expand all
47 base::Optional<base::TimeDelta>() /* first_background_time */, 49 base::Optional<base::TimeDelta>() /* first_background_time */,
48 base::Optional<base::TimeDelta>() /* first_foreground_time */, 50 base::Optional<base::TimeDelta>() /* first_foreground_time */,
49 started_in_foreground /* started_in_foreground */, 51 started_in_foreground /* started_in_foreground */,
50 UserInitiatedInfo::BrowserInitiated(), url, url, true /* did_commit */, 52 UserInitiatedInfo::BrowserInitiated(), url, url, true /* did_commit */,
51 page_load_metrics::END_NONE, 53 page_load_metrics::END_NONE,
52 page_load_metrics::UserInitiatedInfo::NotUserInitiated(), 54 page_load_metrics::UserInitiatedInfo::NotUserInitiated(),
53 base::TimeDelta(), page_load_metrics::PageLoadMetadata(), 55 base::TimeDelta(), page_load_metrics::PageLoadMetadata(),
54 page_load_metrics::PageLoadMetadata()); 56 page_load_metrics::PageLoadMetadata());
55 } 57 }
56 58
57 ExtraRequestInfo::ExtraRequestInfo(bool was_cached, 59 ExtraRequestInfo::ExtraRequestInfo(
58 int64_t raw_body_bytes, 60 bool was_cached,
59 bool data_reduction_proxy_used, 61 int64_t raw_body_bytes,
60 int64_t original_network_content_length) 62 int64_t original_network_content_length,
63 std::unique_ptr<data_reduction_proxy::DataReductionProxyData>
64 data_reduction_proxy_data)
61 : was_cached(was_cached), 65 : was_cached(was_cached),
62 raw_body_bytes(raw_body_bytes), 66 raw_body_bytes(raw_body_bytes),
63 data_reduction_proxy_used(data_reduction_proxy_used), 67 original_network_content_length(original_network_content_length),
64 original_network_content_length(original_network_content_length) {} 68 data_reduction_proxy_data(std::move(data_reduction_proxy_data)) {}
65
66 ExtraRequestInfo::ExtraRequestInfo(const ExtraRequestInfo& other) = default;
67 69
68 ExtraRequestInfo::~ExtraRequestInfo() {} 70 ExtraRequestInfo::~ExtraRequestInfo() {}
69 71
70 FailedProvisionalLoadInfo::FailedProvisionalLoadInfo(base::TimeDelta interval, 72 FailedProvisionalLoadInfo::FailedProvisionalLoadInfo(base::TimeDelta interval,
71 net::Error error) 73 net::Error error)
72 : time_to_failed_provisional_load(interval), error(error) {} 74 : time_to_failed_provisional_load(interval), error(error) {}
73 75
74 FailedProvisionalLoadInfo::~FailedProvisionalLoadInfo() {} 76 FailedProvisionalLoadInfo::~FailedProvisionalLoadInfo() {}
75 77
76 PageLoadMetricsObserver::ObservePolicy PageLoadMetricsObserver::OnStart( 78 PageLoadMetricsObserver::ObservePolicy PageLoadMetricsObserver::OnStart(
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
109 111
110 PageLoadMetricsObserver::ObservePolicy 112 PageLoadMetricsObserver::ObservePolicy
111 PageLoadMetricsObserver::ShouldObserveMimeType( 113 PageLoadMetricsObserver::ShouldObserveMimeType(
112 const std::string& mime_type) const { 114 const std::string& mime_type) const {
113 return mime_type == "text/html" || mime_type == "application/xhtml+xml" 115 return mime_type == "text/html" || mime_type == "application/xhtml+xml"
114 ? CONTINUE_OBSERVING 116 ? CONTINUE_OBSERVING
115 : STOP_OBSERVING; 117 : STOP_OBSERVING;
116 } 118 }
117 119
118 } // namespace page_load_metrics 120 } // namespace page_load_metrics
OLDNEW
« no previous file with comments | « chrome/browser/page_load_metrics/page_load_metrics_observer.h ('k') | chrome/browser/previews/previews_infobar_delegate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698