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

Unified Diff: components/ntp_snippets/remote/request_throttler.cc

Issue 2660953002: [Remote suggestions] Clean up variation params in the request throttler (Closed)
Patch Set: Created 3 years, 11 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/ntp_snippets/remote/request_throttler.cc
diff --git a/components/ntp_snippets/remote/request_throttler.cc b/components/ntp_snippets/remote/request_throttler.cc
index ae78103892b5deb4e65ed7d503353c4ec60452ab..bba80a2ce1cc304c551000285ea9f81cc6983be5 100644
--- a/components/ntp_snippets/remote/request_throttler.cc
+++ b/components/ntp_snippets/remote/request_throttler.cc
@@ -13,6 +13,7 @@
#include "base/strings/string_split.h"
#include "base/strings/stringprintf.h"
#include "base/time/time.h"
+#include "components/ntp_snippets/features.h"
#include "components/ntp_snippets/ntp_snippets_constants.h"
#include "components/ntp_snippets/pref_names.h"
#include "components/prefs/pref_registry_simple.h"
@@ -76,8 +77,8 @@ RequestThrottler::RequestThrottler(PrefService* pref_service, RequestType type)
type_info_(kRequestTypeInfo[static_cast<int>(type)]) {
DCHECK(pref_service);
- std::string quota = variations::GetVariationParamValue(
- ntp_snippets::kStudyName,
+ std::string quota = variations::GetVariationParamValueByFeature(
+ ntp_snippets::kArticleSuggestionsFeature,
base::StringPrintf("quota_%s", GetRequestTypeName()));
if (!base::StringToInt(quota, &quota_)) {
LOG_IF(WARNING, !quota.empty())
@@ -86,8 +87,8 @@ RequestThrottler::RequestThrottler(PrefService* pref_service, RequestType type)
quota_ = type_info_.default_quota;
}
- std::string interactive_quota = variations::GetVariationParamValue(
- ntp_snippets::kStudyName,
+ std::string interactive_quota = variations::GetVariationParamValueByFeature(
+ ntp_snippets::kArticleSuggestionsFeature,
base::StringPrintf("interactive_quota_%s", GetRequestTypeName()));
if (!base::StringToInt(interactive_quota, &interactive_quota_)) {
LOG_IF(WARNING, !interactive_quota.empty())
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698