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..a40ce2af49eb5d8f1fbe75d82f0093fba5655163 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; |
+ // TODO(petewil): Use actual signal type instead of hardcoding name to |
+ // image. |
+ // Add the signal to extra data, and use for tracking. |
+ if (type == ResourceDataType::IMAGE) { |
+ if (started) { |
+ started_count_++; |
+ signal_data_.SetDouble("StartedImages", started_count_); |
+ } else { |
+ completed_count_++; |
+ signal_data_.SetDouble("CompletedImages", completed_count_); |
+ } |
+ } |
} |
void BackgroundLoaderOffliner::OnNetworkBytesChanged(int64_t bytes) { |