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

Unified Diff: chrome/browser/android/offline_pages/prerendering_loader.cc

Issue 2857063002: Add a way to send the resource percentage signal to the RC. (Closed)
Patch Set: CR Feedback per Dimich, BMcQuade, and CSHarrison Created 3 years, 7 months 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/android/offline_pages/prerendering_loader.cc
diff --git a/chrome/browser/android/offline_pages/prerendering_loader.cc b/chrome/browser/android/offline_pages/prerendering_loader.cc
index 5eccbf9f696600b8045c7cfbf5e1cf3c315d6fe7..1e1e7578f41d797af1b584564a0197ee10af5684 100644
--- a/chrome/browser/android/offline_pages/prerendering_loader.cc
+++ b/chrome/browser/android/offline_pages/prerendering_loader.cc
@@ -199,6 +199,21 @@ bool PrerenderingLoader::IsLowbarMet() {
return is_lowbar_met_;
}
+void PrerenderingLoader::ObserveResourceTracking(
+ const Offliner::ResourceDataType type,
+ int64_t started_count,
+ int64_t completed_count) {
+ // Add the signal to extra data, and use for tracking.
+ if (type == Offliner::ResourceDataType::IMAGE) {
+ double percentage = 100 * static_cast<double>(completed_count) /
+ static_cast<double>(started_count);
+ // TODO(petewil): Use actual signal type instead of hardcoding name.
+ signal_data_.SetDouble("ImagePercentage", percentage);
+ signal_data_.SetDouble("StartedImages", started_count);
+ signal_data_.SetDouble("CompletedImages", completed_count);
+ }
+}
+
void PrerenderingLoader::HandleLoadEvent() {
// If still loading, check if the load succeeded or not, then update
// the internal state (LOADED for success or IDLE for failure) and post

Powered by Google App Engine
This is Rietveld 408576698