Chromium Code Reviews| 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 // Provides global database of differential decompression dictionaries for the | 5 // Provides global database of differential decompression dictionaries for the |
| 6 // SDCH filter (processes sdch enconded content). | 6 // SDCH filter (processes sdch enconded content). |
| 7 | 7 |
| 8 // Exactly one instance of SdchManager is built, and all references are made | 8 // Exactly one instance of SdchManager is built, and all references are made |
| 9 // into that collection. | 9 // into that collection. |
| 10 // | 10 // |
| (...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 239 SdchManager(); | 239 SdchManager(); |
| 240 ~SdchManager(); | 240 ~SdchManager(); |
| 241 | 241 |
| 242 // Clear data (for browser data removal). | 242 // Clear data (for browser data removal). |
| 243 void ClearData(); | 243 void ClearData(); |
| 244 | 244 |
| 245 // Record stats on various errors. | 245 // Record stats on various errors. |
| 246 static void SdchErrorRecovery(ProblemCodes problem); | 246 static void SdchErrorRecovery(ProblemCodes problem); |
| 247 | 247 |
| 248 // Register a fetcher that this class can use to obtain dictionaries. | 248 // Register a fetcher that this class can use to obtain dictionaries. |
| 249 void set_sdch_fetcher(SdchFetcher* fetcher); | 249 void set_sdch_fetcher(scoped_ptr<SdchFetcher> fetcher); |
| 250 | 250 |
| 251 // Enables or disables SDCH compression. | 251 // Enables or disables SDCH compression. |
| 252 static void EnableSdchSupport(bool enabled); | 252 static void EnableSdchSupport(bool enabled); |
| 253 | 253 |
| 254 static bool sdch_enabled() { return g_sdch_enabled_; } | 254 static bool sdch_enabled() { return g_sdch_enabled_; } |
| 255 | 255 |
| 256 // Enables or disables SDCH compression over secure connection. | 256 // Enables or disables SDCH compression over secure connection. |
| 257 static void EnableSecureSchemeSupport(bool enabled); | 257 static void EnableSecureSchemeSupport(bool enabled); |
| 258 | 258 |
| 259 static bool secure_scheme_supported() { return g_secure_scheme_supported_; } | 259 static bool secure_scheme_supported() { return g_secure_scheme_supported_; } |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 329 std::string* client_hash, std::string* server_hash); | 329 std::string* client_hash, std::string* server_hash); |
| 330 | 330 |
| 331 // For Latency testing only, we need to know if we've succeeded in doing a | 331 // For Latency testing only, we need to know if we've succeeded in doing a |
| 332 // round trip before starting our comparative tests. If ever we encounter | 332 // round trip before starting our comparative tests. If ever we encounter |
| 333 // problems with SDCH, we opt-out of the test unless/until we perform a | 333 // problems with SDCH, we opt-out of the test unless/until we perform a |
| 334 // complete SDCH decoding. | 334 // complete SDCH decoding. |
| 335 bool AllowLatencyExperiment(const GURL& url) const; | 335 bool AllowLatencyExperiment(const GURL& url) const; |
| 336 | 336 |
| 337 void SetAllowLatencyExperiment(const GURL& url, bool enable); | 337 void SetAllowLatencyExperiment(const GURL& url, bool enable); |
| 338 | 338 |
| 339 int GetFetchesRequestedForTesting() const; | |
|
mef
2014/07/10 16:31:42
I think code guide suggest calling simple getter f
| |
| 340 | |
| 339 private: | 341 private: |
| 340 typedef std::map<std::string, int> DomainCounter; | 342 typedef std::map<std::string, int> DomainCounter; |
| 341 typedef std::set<std::string> ExperimentSet; | 343 typedef std::set<std::string> ExperimentSet; |
| 342 | 344 |
| 343 // A map of dictionaries info indexed by the hash that the server provides. | 345 // A map of dictionaries info indexed by the hash that the server provides. |
| 344 typedef std::map<std::string, scoped_refptr<Dictionary> > DictionaryMap; | 346 typedef std::map<std::string, scoped_refptr<Dictionary> > DictionaryMap; |
| 345 | 347 |
| 346 // Support SDCH compression, by advertising in headers. | 348 // Support SDCH compression, by advertising in headers. |
| 347 static bool g_sdch_enabled_; | 349 static bool g_sdch_enabled_; |
| 348 | 350 |
| (...skipping 14 matching lines...) Expand all Loading... | |
| 363 DomainCounter blacklisted_domains_; | 365 DomainCounter blacklisted_domains_; |
| 364 | 366 |
| 365 // Support exponential backoff in number of domain accesses before | 367 // Support exponential backoff in number of domain accesses before |
| 366 // blacklisting expires. | 368 // blacklisting expires. |
| 367 DomainCounter exponential_blacklist_count_; | 369 DomainCounter exponential_blacklist_count_; |
| 368 | 370 |
| 369 // List of hostnames for which a latency experiment is allowed (because a | 371 // List of hostnames for which a latency experiment is allowed (because a |
| 370 // round trip test has recently passed). | 372 // round trip test has recently passed). |
| 371 ExperimentSet allow_latency_experiment_; | 373 ExperimentSet allow_latency_experiment_; |
| 372 | 374 |
| 375 int fetches_requested_; | |
| 376 | |
| 373 DISALLOW_COPY_AND_ASSIGN(SdchManager); | 377 DISALLOW_COPY_AND_ASSIGN(SdchManager); |
| 374 }; | 378 }; |
| 375 | 379 |
| 376 } // namespace net | 380 } // namespace net |
| 377 | 381 |
| 378 #endif // NET_BASE_SDCH_MANAGER_H_ | 382 #endif // NET_BASE_SDCH_MANAGER_H_ |
| OLD | NEW |