// Copyright 2012 The Chromium Authors // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef EXTENSIONS_RENDERER_EXTENSION_THROTTLE_ENTRY_H_ #define EXTENSIONS_RENDERER_EXTENSION_THROTTLE_ENTRY_H_ #include <stdint.h> #include <string> #include "base/containers/queue.h" #include "base/time/time.h" #include "net/base/backoff_entry.h" namespace extensions { // ExtensionThrottleEntry represents an entry of ExtensionThrottleManager. // It analyzes requests of a specific URL over some period of time, in order to // deduce the back-off time for every request. // The back-off algorithm consists of two parts. Firstly, exponential back-off // is used when receiving 5XX server errors or malformed response bodies. // The exponential back-off rule is enforced by URLRequestHttpJob. Any // request sent during the back-off period will be cancelled. // Secondly, a sliding window is used to count recent requests to a given // destination and provide guidance (to the application level only) on whether // too many requests have been sent and when a good time to send the next one // would be. This is never used to deny requests at the network level. class ExtensionThrottleEntry { … }; } // namespace extensions #endif // EXTENSIONS_RENDERER_EXTENSION_THROTTLE_ENTRY_H_