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 #include "chrome/browser/page_load_metrics/metrics_web_contents_observer.h" | 5 #include "chrome/browser/page_load_metrics/metrics_web_contents_observer.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <ostream> | 8 #include <ostream> |
9 #include <string> | 9 #include <string> |
10 #include <utility> | 10 #include <utility> |
(...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
249 return committed_load_.get(); | 249 return committed_load_.get(); |
250 } | 250 } |
251 } | 251 } |
252 return nullptr; | 252 return nullptr; |
253 } | 253 } |
254 | 254 |
255 void MetricsWebContentsObserver::OnRequestComplete( | 255 void MetricsWebContentsObserver::OnRequestComplete( |
256 const content::GlobalRequestID& request_id, | 256 const content::GlobalRequestID& request_id, |
257 content::ResourceType resource_type, | 257 content::ResourceType resource_type, |
258 bool was_cached, | 258 bool was_cached, |
259 bool used_data_reduction_proxy, | 259 std::unique_ptr<data_reduction_proxy::DataReductionProxyData> |
| 260 data_reduction_proxy_data, |
260 int64_t raw_body_bytes, | 261 int64_t raw_body_bytes, |
261 int64_t original_content_length, | 262 int64_t original_content_length, |
262 base::TimeTicks creation_time) { | 263 base::TimeTicks creation_time) { |
263 PageLoadTracker* tracker = | 264 PageLoadTracker* tracker = |
264 GetTrackerOrNullForRequest(request_id, resource_type, creation_time); | 265 GetTrackerOrNullForRequest(request_id, resource_type, creation_time); |
265 if (tracker) { | 266 if (tracker) { |
266 ExtraRequestInfo extra_request_info( | 267 ExtraRequestInfo extra_request_info( |
267 was_cached, raw_body_bytes, used_data_reduction_proxy, | 268 was_cached, raw_body_bytes, was_cached ? 0 : original_content_length, |
268 was_cached ? 0 : original_content_length); | 269 std::move(data_reduction_proxy_data)); |
269 tracker->OnLoadedResource(extra_request_info); | 270 tracker->OnLoadedResource(extra_request_info); |
270 } | 271 } |
271 } | 272 } |
272 | 273 |
273 void MetricsWebContentsObserver::OnNavigationDelayComplete( | 274 void MetricsWebContentsObserver::OnNavigationDelayComplete( |
274 content::NavigationHandle* navigation_handle, | 275 content::NavigationHandle* navigation_handle, |
275 base::TimeDelta scheduled_delay, | 276 base::TimeDelta scheduled_delay, |
276 base::TimeDelta actual_delay) { | 277 base::TimeDelta actual_delay) { |
277 auto it = provisional_loads_.find(navigation_handle); | 278 auto it = provisional_loads_.find(navigation_handle); |
278 if (it == provisional_loads_.end()) | 279 if (it == provisional_loads_.end()) |
(...skipping 305 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
584 content::NavigationHandle* navigation_handle) const { | 585 content::NavigationHandle* navigation_handle) const { |
585 DCHECK(navigation_handle->IsInMainFrame()); | 586 DCHECK(navigation_handle->IsInMainFrame()); |
586 DCHECK(!navigation_handle->HasCommitted() || | 587 DCHECK(!navigation_handle->HasCommitted() || |
587 !navigation_handle->IsSameDocument()); | 588 !navigation_handle->IsSameDocument()); |
588 | 589 |
589 return BrowserPageTrackDecider(embedder_interface_.get(), web_contents(), | 590 return BrowserPageTrackDecider(embedder_interface_.get(), web_contents(), |
590 navigation_handle).ShouldTrack(); | 591 navigation_handle).ShouldTrack(); |
591 } | 592 } |
592 | 593 |
593 } // namespace page_load_metrics | 594 } // namespace page_load_metrics |
OLD | NEW |