OLD | NEW |
(Empty) | |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "chrome/browser/page_load_metrics/observers/resource_tracking_page_load
_metrics_observer.h" |
| 6 |
| 7 namespace page_load_metrics { |
| 8 |
| 9 ResourceTrackingPageLoadMetricsObserver:: |
| 10 ResourceTrackingPageLoadMetricsObserver() |
| 11 : started_count_(0), completed_count_(0) {} |
| 12 ResourceTrackingPageLoadMetricsObserver:: |
| 13 ~ResourceTrackingPageLoadMetricsObserver() {} |
| 14 |
| 15 void ResourceTrackingPageLoadMetricsObserver::OnStartedResource( |
| 16 const ExtraRequestStartInfo& extra_request_start_info) { |
| 17 // TODO(petewiL): Store this by type. |
| 18 ++started_count_; |
| 19 } |
| 20 |
| 21 void ResourceTrackingPageLoadMetricsObserver::OnLoadedResource( |
| 22 const ExtraRequestCompleteInfo& extra_request_complete_info) { |
| 23 // TODO(petewil): Check to see if the type of the request changed. If it did, |
| 24 // update the old and new types for the started type. Then update by type for |
| 25 // the completed type. |
| 26 ++completed_count_; |
| 27 } |
| 28 |
| 29 void ResourceTrackingPageLoadMetricsObserver::GetCountsForTypeForTesting( |
| 30 const content::ResourceType type, |
| 31 int64_t* started_count, |
| 32 int64_t* completed_count) { |
| 33 if (started_count != nullptr) |
| 34 *started_count = started_count_; |
| 35 if (completed_count != nullptr) |
| 36 *completed_count = completed_count_; |
| 37 } |
| 38 |
| 39 } // namespace page_load_metrics |
OLD | NEW |