Chromium Code Reviews| 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..a240bfcc9992245cf2e933bb90aa574be5142f00 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,17 @@ class RequestThrottler { |
| bool DemandQuotaForRequest(bool force_request); |
| private: |
| + // Used internally for working with a RequestType. |
| + struct RequestTypeInfo { |
|
Bernhard Bauer
2016/07/26 09:52:45
Do you need to define the struct here or would a d
jkrcal
2016/07/26 10:05:07
Done.
|
| + 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]; |
|
Bernhard Bauer
2016/07/26 09:52:45
Same here for the array size -- could you just lea
jkrcal
2016/07/26 10:05:07
Ah, right!
|
| + |
| // Also emits the PerDay histogram if the day changed. |
| void ResetCounterIfDayChanged(); |