// Copyright 2017 The Chromium Authors // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef COMPONENTS_SAFE_BROWSING_CONTENT_BROWSER_TRIGGERS_TRIGGER_THROTTLER_H_ #define COMPONENTS_SAFE_BROWSING_CONTENT_BROWSER_TRIGGERS_TRIGGER_THROTTLER_H_ #include <memory> #include <unordered_map> #include <vector> #include "base/gtest_prod_util.h" #include "base/memory/raw_ptr.h" #include "base/time/clock.h" #include "base/time/time.h" class PrefService; namespace safe_browsing { // Default quota for ad sampler trigger. extern const size_t kAdSamplerTriggerDefaultQuota; // Default quota for suspicious site trigger. extern const size_t kSuspiciousSiteTriggerDefaultQuota; // Param name of the finch param containing the quota for the suspicious site // trigger. extern const char kSuspiciousSiteTriggerQuotaParam[]; enum class TriggerType { … }; struct TriggerTypeHash { … }; // A map for storing a list of event timestamps for different trigger types. TriggerTimestampMap; // A pair containing a TriggerType and its associated daily report quota. TriggerTypeAndQuotaItem; // TriggerThrottler keeps track of how often each type of trigger gets fired // and throttles them if they fire too often. class TriggerThrottler { … }; } // namespace safe_browsing #endif // COMPONENTS_SAFE_BROWSING_CONTENT_BROWSER_TRIGGERS_TRIGGER_THROTTLER_H_