OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef NET_URL_REQUEST_URL_REQUEST_THROTTLER_MANAGER_H_ | 5 #ifndef NET_URL_REQUEST_URL_REQUEST_THROTTLER_MANAGER_H_ |
6 #define NET_URL_REQUEST_URL_REQUEST_THROTTLER_MANAGER_H_ | 6 #define NET_URL_REQUEST_URL_REQUEST_THROTTLER_MANAGER_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <set> | 9 #include <set> |
10 #include <string> | 10 #include <string> |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
71 | 71 |
72 // Whether throttling is enabled or not. | 72 // Whether throttling is enabled or not. |
73 void set_enforce_throttling(bool enforce); | 73 void set_enforce_throttling(bool enforce); |
74 bool enforce_throttling(); | 74 bool enforce_throttling(); |
75 | 75 |
76 // Sets the NetLog instance to use. | 76 // Sets the NetLog instance to use. |
77 void set_net_log(NetLog* net_log); | 77 void set_net_log(NetLog* net_log); |
78 NetLog* net_log() const; | 78 NetLog* net_log() const; |
79 | 79 |
80 // IPAddressObserver interface. | 80 // IPAddressObserver interface. |
81 virtual void OnIPAddressChanged() OVERRIDE; | 81 virtual void OnIPAddressChanged() override; |
82 | 82 |
83 // ConnectionTypeObserver interface. | 83 // ConnectionTypeObserver interface. |
84 virtual void OnConnectionTypeChanged( | 84 virtual void OnConnectionTypeChanged( |
85 NetworkChangeNotifier::ConnectionType type) OVERRIDE; | 85 NetworkChangeNotifier::ConnectionType type) override; |
86 | 86 |
87 // Method that allows us to transform a URL into an ID that can be used in our | 87 // Method that allows us to transform a URL into an ID that can be used in our |
88 // map. Resulting IDs will be lowercase and consist of the scheme, host, port | 88 // map. Resulting IDs will be lowercase and consist of the scheme, host, port |
89 // and path (without query string, fragment, etc.). | 89 // and path (without query string, fragment, etc.). |
90 // If the URL is invalid, the invalid spec will be returned, without any | 90 // If the URL is invalid, the invalid spec will be returned, without any |
91 // transformation. | 91 // transformation. |
92 std::string GetIdFromUrl(const GURL& url) const; | 92 std::string GetIdFromUrl(const GURL& url) const; |
93 | 93 |
94 // Method that ensures the map gets cleaned from time to time. The period at | 94 // Method that ensures the map gets cleaned from time to time. The period at |
95 // which garbage collecting happens is adjustable with the | 95 // which garbage collecting happens is adjustable with the |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
157 | 157 |
158 // Valid once we've registered for network notifications. | 158 // Valid once we've registered for network notifications. |
159 base::PlatformThreadId registered_from_thread_; | 159 base::PlatformThreadId registered_from_thread_; |
160 | 160 |
161 DISALLOW_COPY_AND_ASSIGN(URLRequestThrottlerManager); | 161 DISALLOW_COPY_AND_ASSIGN(URLRequestThrottlerManager); |
162 }; | 162 }; |
163 | 163 |
164 } // namespace net | 164 } // namespace net |
165 | 165 |
166 #endif // NET_URL_REQUEST_URL_REQUEST_THROTTLER_MANAGER_H_ | 166 #endif // NET_URL_REQUEST_URL_REQUEST_THROTTLER_MANAGER_H_ |
OLD | NEW |