Chromium Code Reviews| Index: chrome/browser/offline_pages/background_loader_offliner.cc |
| diff --git a/chrome/browser/offline_pages/background_loader_offliner.cc b/chrome/browser/offline_pages/background_loader_offliner.cc |
| index c5203bb8e51b9f68c575ce3c231f5a46b1163b30..144467cc60c0dd28ad404a34886a37157f19a212 100644 |
| --- a/chrome/browser/offline_pages/background_loader_offliner.cc |
| +++ b/chrome/browser/offline_pages/background_loader_offliner.cc |
| @@ -106,6 +106,8 @@ BackgroundLoaderOffliner::BackgroundLoaderOffliner( |
| network_bytes_(0LL), |
| is_low_bar_met_(false), |
| did_snapshot_on_last_retry_(false), |
| + started_count_(0LL), |
| + completed_count_(0LL), |
| weak_ptr_factory_(this) { |
| DCHECK(offline_page_model_); |
| DCHECK(browser_context_); |
| @@ -348,8 +350,18 @@ void BackgroundLoaderOffliner::SetSnapshotControllerForTest( |
| void BackgroundLoaderOffliner::ObserveResourceLoading( |
| ResourceLoadingObserver::ResourceDataType type, |
| bool started) { |
| - // TODO(petewil) Not implemented yet. |
| - return; |
| + // Add the signal to extra data, and use for tracking. |
| + if (type == ResourceDataType::IMAGE) { |
| + if (started) |
| + started_count_++; |
| + else |
| + completed_count_++; |
| + |
| + // TODO(petewil): Use actual signal type instead of hardcoding name to |
| + // image. |
| + signal_data_.SetDouble("StartedImages", started_count_); |
|
fgorski
2017/06/22 16:52:38
why setting both if only one changed?
Pete Williamson
2017/06/22 17:14:38
Done.
|
| + signal_data_.SetDouble("CompletedImages", completed_count_); |
| + } |
| } |
| void BackgroundLoaderOffliner::OnNetworkBytesChanged(int64_t bytes) { |