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" |
(...skipping 15 matching lines...) Expand all Loading... |
26 #else | 26 #else |
27 // static | 27 // static |
28 const size_t SdchManager::kMaxDictionaryCount = 20; | 28 const size_t SdchManager::kMaxDictionaryCount = 20; |
29 const size_t SdchManager::kMaxDictionarySize = 1000 * 1000; | 29 const size_t SdchManager::kMaxDictionarySize = 1000 * 1000; |
30 #endif | 30 #endif |
31 | 31 |
32 // static | 32 // static |
33 bool SdchManager::g_sdch_enabled_ = true; | 33 bool SdchManager::g_sdch_enabled_ = true; |
34 | 34 |
35 // static | 35 // static |
36 bool SdchManager::g_secure_scheme_supported_ = false; | 36 bool SdchManager::g_secure_scheme_supported_ = true; |
37 | 37 |
38 //------------------------------------------------------------------------------ | 38 //------------------------------------------------------------------------------ |
39 SdchManager::Dictionary::Dictionary(const std::string& dictionary_text, | 39 SdchManager::Dictionary::Dictionary(const std::string& dictionary_text, |
40 size_t offset, | 40 size_t offset, |
41 const std::string& client_hash, | 41 const std::string& client_hash, |
42 const GURL& gurl, | 42 const GURL& gurl, |
43 const std::string& domain, | 43 const std::string& domain, |
44 const std::string& path, | 44 const std::string& path, |
45 const base::Time& expiration, | 45 const base::Time& expiration, |
46 const std::set<int>& ports) | 46 const std::set<int>& ports) |
(...skipping 536 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
583 void SdchManager::UrlSafeBase64Encode(const std::string& input, | 583 void SdchManager::UrlSafeBase64Encode(const std::string& input, |
584 std::string* output) { | 584 std::string* output) { |
585 // Since this is only done during a dictionary load, and hashes are only 8 | 585 // Since this is only done during a dictionary load, and hashes are only 8 |
586 // characters, we just do the simple fixup, rather than rewriting the encoder. | 586 // characters, we just do the simple fixup, rather than rewriting the encoder. |
587 base::Base64Encode(input, output); | 587 base::Base64Encode(input, output); |
588 std::replace(output->begin(), output->end(), '+', '-'); | 588 std::replace(output->begin(), output->end(), '+', '-'); |
589 std::replace(output->begin(), output->end(), '/', '_'); | 589 std::replace(output->begin(), output->end(), '/', '_'); |
590 } | 590 } |
591 | 591 |
592 } // namespace net | 592 } // namespace net |
OLD | NEW |