Chromium Code Reviews| 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 #include "net/base/sdch_manager.h" | 5 #include "net/base/sdch_manager.h" |
| 6 | 6 |
| 7 #include "base/base64.h" | 7 #include "base/base64.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "base/metrics/histogram.h" | 9 #include "base/metrics/histogram.h" |
| 10 #include "base/strings/string_number_conversions.h" | 10 #include "base/strings/string_number_conversions.h" |
| 11 #include "base/strings/string_util.h" | 11 #include "base/strings/string_util.h" |
| 12 #include "crypto/sha2.h" | 12 #include "crypto/sha2.h" |
| 13 #include "net/base/registry_controlled_domains/registry_controlled_domain.h" | 13 #include "net/base/registry_controlled_domains/registry_controlled_domain.h" |
| 14 #include "net/url_request/url_request_http_job.h" | 14 #include "net/url_request/url_request_http_job.h" |
| 15 | 15 |
| 16 namespace net { | 16 namespace net { |
| 17 | 17 |
| 18 //------------------------------------------------------------------------------ | 18 //------------------------------------------------------------------------------ |
| 19 // static | 19 // static |
| 20 const size_t SdchManager::kMaxDictionarySize = 1000000; | |
| 21 | 20 |
| 21 // Adjust SDCH limits downwards for mobile. | |
| 22 #if defined(OS_ANDROID) || defined(OS_IOS) | |
| 22 // static | 23 // static |
| 23 const size_t SdchManager::kMaxDictionaryCount = 20; | 24 const size_t SdchManager::kMaxDictionaryCount = 2; |
|
cbentzel
2014/06/18 20:47:43
Limit we agreed on was 150KB max for Android - thi
Randy Smith (Not in Mondays)
2014/06/18 21:16:40
Fixed.
| |
| 25 const size_t SdchManager::kMaxDictionarySize = 300 * 1000; | |
| 26 #else | |
| 27 // static | |
| 28 const size_t SdchManager::kMaxDictionaryCount = 5; | |
|
cbentzel
2014/06/18 20:47:43
Why did these change?
Randy Smith (Not in Mondays)
2014/06/18 21:16:40
Because I think desktop chrome is a bit of a pig a
| |
| 29 const size_t SdchManager::kMaxDictionarySize = 500 * 1000; | |
| 30 #endif | |
| 24 | 31 |
| 25 // static | 32 // static |
| 26 bool SdchManager::g_sdch_enabled_ = true; | 33 bool SdchManager::g_sdch_enabled_ = true; |
| 27 | 34 |
| 28 // static | 35 // static |
| 29 bool SdchManager::g_secure_scheme_supported_ = false; | 36 bool SdchManager::g_secure_scheme_supported_ = false; |
| 30 | 37 |
| 31 //------------------------------------------------------------------------------ | 38 //------------------------------------------------------------------------------ |
| 32 SdchManager::Dictionary::Dictionary(const std::string& dictionary_text, | 39 SdchManager::Dictionary::Dictionary(const std::string& dictionary_text, |
| 33 size_t offset, | 40 size_t offset, |
| (...skipping 516 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 550 case '/': | 557 case '/': |
| 551 (*output)[i] = '_'; | 558 (*output)[i] = '_'; |
| 552 continue; | 559 continue; |
| 553 default: | 560 default: |
| 554 continue; | 561 continue; |
| 555 } | 562 } |
| 556 } | 563 } |
| 557 } | 564 } |
| 558 | 565 |
| 559 } // namespace net | 566 } // namespace net |
| OLD | NEW |