// 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_MANAGER_H_ #define EXTENSIONS_RENDERER_EXTENSION_THROTTLE_MANAGER_H_ #include <map> #include <memory> #include <string> #include "base/synchronization/lock.h" #include "extensions/renderer/extension_throttle_entry.h" #include "services/network/public/mojom/url_response_head.mojom-forward.h" #include "url/gurl.h" namespace blink { class URLLoaderThrottle; } // namespace blink namespace net { struct RedirectInfo; } // namespace net namespace network { struct ResourceRequest; } // namespace network namespace extensions { // This is a thread safe class that registers URL request throttler entries for // URLs being accessed in order to supervise traffic. URL requests for HTTP // contents should register their URLs in this manager on each request. // // ExtensionThrottleManager maintains a map of URL IDs to URL request // throttler entries. It creates URL request throttler entries when new URLs // are registered, and does garbage collection from time to time in order to // clean out outdated entries. URL ID consists of lowercased scheme, host, port // and path. All URLs converted to the same ID will share the same entry. class ExtensionThrottleManager { … }; } // namespace extensions #endif // EXTENSIONS_RENDERER_EXTENSION_THROTTLE_MANAGER_H_