Index: components/ntp_snippets/request_throttler.h |
diff --git a/components/ntp_snippets/request_throttler.h b/components/ntp_snippets/request_throttler.h |
index f908825814b62fcb0790aca1a1a2702aeb91013f..6fcdc40d1060b7621acf7465979a4a0baf32f84b 100644 |
--- a/components/ntp_snippets/request_throttler.h |
+++ b/components/ntp_snippets/request_throttler.h |
@@ -18,8 +18,6 @@ class HistogramBase; |
namespace ntp_snippets { |
-struct RequestTypeInfo; |
- |
// Counts requests to external services, compares them to a daily quota, reports |
// them to UMA. In the application code, create one local instance for each type |
// of requests, identified by the RequestType. The request counter is based on: |
@@ -45,9 +43,7 @@ class RequestThrottler { |
CONTENT_SUGGESTION_FETCHER |
}; |
- RequestThrottler(PrefService* pref_service, |
- RequestType type, |
- int default_quota); |
+ RequestThrottler(PrefService* pref_service, RequestType type); |
// Registers profile prefs for all RequestTypes. Called from browser_prefs.cc. |
static void RegisterProfilePrefs(PrefRegistrySimple* registry); |
@@ -59,6 +55,18 @@ class RequestThrottler { |
bool DemandQuotaForRequest(bool force_request); |
private: |
+ friend class RequestThrottlerTest; |
+ // Used internally for working with a RequestType. |
+ struct RequestTypeInfo { |
+ const char* name; |
+ const char* count_pref; |
+ const char* day_pref; |
+ const int default_quota; |
+ }; |
+ |
+ // The array of info entries - one per each RequestType. |
+ static const RequestTypeInfo kRequestTypeInfo[1]; |
+ |
// Also emits the PerDay histogram if the day changed. |
void ResetCounterIfDayChanged(); |