| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 // This file contains the SdchManager class and the DictionarySet | 5 // This file contains the SdchManager class and the DictionarySet |
| 6 // nested class. The manager is responsible for storing all | 6 // nested class. The manager is responsible for storing all |
| 7 // SdchDictionarys, and provides access to them through DictionarySet | 7 // SdchDictionarys, and provides access to them through DictionarySet |
| 8 // objects. A DictionarySet is an object whose lifetime is under the | 8 // objects. A DictionarySet is an object whose lifetime is under the |
| 9 // control of the consumer. It is a reference to a set of | 9 // control of the consumer. It is a reference to a set of |
| 10 // dictionaries, and guarantees that none of those dictionaries will | 10 // dictionaries, and guarantees that none of those dictionaries will |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 91 | 91 |
| 92 SdchManager(); | 92 SdchManager(); |
| 93 ~SdchManager(); | 93 ~SdchManager(); |
| 94 | 94 |
| 95 // Clear data (for browser data removal). | 95 // Clear data (for browser data removal). |
| 96 void ClearData(); | 96 void ClearData(); |
| 97 | 97 |
| 98 // Record stats on various errors. | 98 // Record stats on various errors. |
| 99 static void SdchErrorRecovery(SdchProblemCode problem); | 99 static void SdchErrorRecovery(SdchProblemCode problem); |
| 100 | 100 |
| 101 // Enables or disables SDCH compression. | |
| 102 static void EnableSdchSupport(bool enabled); | |
| 103 | |
| 104 static bool sdch_enabled() { return g_sdch_enabled_; } | |
| 105 | |
| 106 // Briefly prevent further advertising of SDCH on this domain (if SDCH is | 101 // Briefly prevent further advertising of SDCH on this domain (if SDCH is |
| 107 // enabled). After enough calls to IsInSupportedDomain() the blacklisting | 102 // enabled). After enough calls to IsInSupportedDomain() the blacklisting |
| 108 // will be removed. Additional blacklists take exponentially more calls | 103 // will be removed. Additional blacklists take exponentially more calls |
| 109 // to IsInSupportedDomain() before the blacklisting is undone. | 104 // to IsInSupportedDomain() before the blacklisting is undone. |
| 110 // Used when filter errors are found from a given domain, but it is plausible | 105 // Used when filter errors are found from a given domain, but it is plausible |
| 111 // that the cause is temporary (such as application startup, where cached | 106 // that the cause is temporary (such as application startup, where cached |
| 112 // entries are used, but a dictionary is not yet loaded). | 107 // entries are used, but a dictionary is not yet loaded). |
| 113 void BlacklistDomain(const GURL& url, SdchProblemCode blacklist_reason); | 108 void BlacklistDomain(const GURL& url, SdchProblemCode blacklist_reason); |
| 114 | 109 |
| 115 // Used when SEVERE filter errors are found from a given domain, to prevent | 110 // Used when SEVERE filter errors are found from a given domain, to prevent |
| (...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 242 base::ObserverList<SdchObserver, true> observers_; | 237 base::ObserverList<SdchObserver, true> observers_; |
| 243 | 238 |
| 244 base::ThreadChecker thread_checker_; | 239 base::ThreadChecker thread_checker_; |
| 245 | 240 |
| 246 DISALLOW_COPY_AND_ASSIGN(SdchManager); | 241 DISALLOW_COPY_AND_ASSIGN(SdchManager); |
| 247 }; | 242 }; |
| 248 | 243 |
| 249 } // namespace net | 244 } // namespace net |
| 250 | 245 |
| 251 #endif // NET_BASE_SDCH_MANAGER_H_ | 246 #endif // NET_BASE_SDCH_MANAGER_H_ |
| OLD | NEW |