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

Side by Side Diff: chrome/browser/page_load_metrics/observers/data_reduction_proxy_metrics_observer.cc

Issue 2593793002: Remove call to WasHidden as part of the app being backgrounded. (Closed)
Patch Set: add comment Created 4 years 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
« no previous file with comments | « chrome/browser/page_load_metrics/observers/data_reduction_proxy_metrics_observer.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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/observers/data_reduction_proxy_metric s_observer.h" 5 #include "chrome/browser/page_load_metrics/observers/data_reduction_proxy_metric s_observer.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/optional.h" 9 #include "base/optional.h"
10 #include "base/time/time.h" 10 #include "base/time/time.h"
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
125 } 125 }
126 126
127 page_load_metrics::PageLoadMetricsObserver::ObservePolicy 127 page_load_metrics::PageLoadMetricsObserver::ObservePolicy
128 DataReductionProxyMetricsObserver::OnHidden( 128 DataReductionProxyMetricsObserver::OnHidden(
129 const page_load_metrics::PageLoadTiming& timing, 129 const page_load_metrics::PageLoadTiming& timing,
130 const page_load_metrics::PageLoadExtraInfo& info) { 130 const page_load_metrics::PageLoadExtraInfo& info) {
131 SendPingback(timing, info); 131 SendPingback(timing, info);
132 return STOP_OBSERVING; 132 return STOP_OBSERVING;
133 } 133 }
134 134
135 page_load_metrics::PageLoadMetricsObserver::ObservePolicy
136 DataReductionProxyMetricsObserver::FlushMetricsOnAppEnterBackground(
137 const page_load_metrics::PageLoadTiming& timing,
138 const page_load_metrics::PageLoadExtraInfo& info) {
139 // FlushMetricsOnAppEnterBackground is invoked on Android in cases where the
140 // app is about to be backgrounded, as part of the Activity.onPause()
141 // flow. After this method is invoked, Chrome may be killed without further
142 // notification, so we send a pingback with data collected up to this point.
143 SendPingback(timing, info);
144 return STOP_OBSERVING;
145 }
146
135 void DataReductionProxyMetricsObserver::OnComplete( 147 void DataReductionProxyMetricsObserver::OnComplete(
136 const page_load_metrics::PageLoadTiming& timing, 148 const page_load_metrics::PageLoadTiming& timing,
137 const page_load_metrics::PageLoadExtraInfo& info) { 149 const page_load_metrics::PageLoadExtraInfo& info) {
138 SendPingback(timing, info); 150 SendPingback(timing, info);
139 } 151 }
140 152
141 void DataReductionProxyMetricsObserver::SendPingback( 153 void DataReductionProxyMetricsObserver::SendPingback(
142 const page_load_metrics::PageLoadTiming& timing, 154 const page_load_metrics::PageLoadTiming& timing,
143 const page_load_metrics::PageLoadExtraInfo& info) { 155 const page_load_metrics::PageLoadExtraInfo& info) {
144 // TODO(ryansturm): Move to OnFirstBackgroundEvent to handle some fast 156 // TODO(ryansturm): Move to OnFirstBackgroundEvent to handle some fast
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
274 286
275 DataReductionProxyPingbackClient* 287 DataReductionProxyPingbackClient*
276 DataReductionProxyMetricsObserver::GetPingbackClient() const { 288 DataReductionProxyMetricsObserver::GetPingbackClient() const {
277 return DataReductionProxyChromeSettingsFactory::GetForBrowserContext( 289 return DataReductionProxyChromeSettingsFactory::GetForBrowserContext(
278 browser_context_) 290 browser_context_)
279 ->data_reduction_proxy_service() 291 ->data_reduction_proxy_service()
280 ->pingback_client(); 292 ->pingback_client();
281 } 293 }
282 294
283 } // namespace data_reduction_proxy 295 } // namespace data_reduction_proxy
OLDNEW
« no previous file with comments | « chrome/browser/page_load_metrics/observers/data_reduction_proxy_metrics_observer.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698