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

Unified Diff: components/contextual_search/browser/ctr_aggregator.cc

Issue 2285633004: [TTS] Record CTR by week and 28-day intervals. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@ctr
Patch Set: Added recording of impressions and getCurrentWeekNumber to invalidate the caching. Created 4 years, 3 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: components/contextual_search/browser/ctr_aggregator.cc
diff --git a/components/contextual_search/browser/ctr_aggregator.cc b/components/contextual_search/browser/ctr_aggregator.cc
index 3010e8093a63fce9d2f709152e39c20ad9191778..f7a6a5b01934b497f8f7cb35135529eab40bebc5 100644
--- a/components/contextual_search/browser/ctr_aggregator.cc
+++ b/components/contextual_search/browser/ctr_aggregator.cc
@@ -44,6 +44,10 @@ void CTRAggregator::RecordImpression(bool did_click) {
storage_.WriteClicks(week_number_, 1 + storage_.ReadClicks(week_number_));
}
+int CTRAggregator::GetCurrentWeekNumber() {
+ return week_number_;
+}
+
bool CTRAggregator::HasPreviousWeekData() {
return storage_.HasData(week_number_ - 1);
}

Powered by Google App Engine
This is Rietveld 408576698