Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(217)

Side by Side Diff: net/base/sdch_manager.cc

Issue 670183003: Update from chromium 62675d9fb31fb8cedc40f68e78e8445a74f362e7 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « net/base/net_util_unittest.cc ('k') | net/base/sdch_manager_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
47 #else 47 #else
48 // static 48 // static
49 const size_t SdchManager::kMaxDictionaryCount = 20; 49 const size_t SdchManager::kMaxDictionaryCount = 20;
50 const size_t SdchManager::kMaxDictionarySize = 1000 * 1000; 50 const size_t SdchManager::kMaxDictionarySize = 1000 * 1000;
51 #endif 51 #endif
52 52
53 // static 53 // static
54 bool SdchManager::g_sdch_enabled_ = true; 54 bool SdchManager::g_sdch_enabled_ = true;
55 55
56 // static 56 // static
57 #if defined(OS_IOS)
58 // Workaround for http://crbug.com/418975; remove when fixed.
59 bool SdchManager::g_secure_scheme_supported_ = false;
60 #else
57 bool SdchManager::g_secure_scheme_supported_ = true; 61 bool SdchManager::g_secure_scheme_supported_ = true;
62 #endif
58 63
59 //------------------------------------------------------------------------------ 64 //------------------------------------------------------------------------------
60 SdchManager::Dictionary::Dictionary(const std::string& dictionary_text, 65 SdchManager::Dictionary::Dictionary(const std::string& dictionary_text,
61 size_t offset, 66 size_t offset,
62 const std::string& client_hash, 67 const std::string& client_hash,
63 const GURL& gurl, 68 const GURL& gurl,
64 const std::string& domain, 69 const std::string& domain,
65 const std::string& path, 70 const std::string& path,
66 const base::Time& expiration, 71 const base::Time& expiration,
67 const std::set<int>& ports) 72 const std::set<int>& ports)
(...skipping 541 matching lines...) Expand 10 before | Expand all | Expand 10 after
609 void SdchManager::UrlSafeBase64Encode(const std::string& input, 614 void SdchManager::UrlSafeBase64Encode(const std::string& input,
610 std::string* output) { 615 std::string* output) {
611 // Since this is only done during a dictionary load, and hashes are only 8 616 // Since this is only done during a dictionary load, and hashes are only 8
612 // characters, we just do the simple fixup, rather than rewriting the encoder. 617 // characters, we just do the simple fixup, rather than rewriting the encoder.
613 base::Base64Encode(input, output); 618 base::Base64Encode(input, output);
614 std::replace(output->begin(), output->end(), '+', '-'); 619 std::replace(output->begin(), output->end(), '+', '-');
615 std::replace(output->begin(), output->end(), '/', '_'); 620 std::replace(output->begin(), output->end(), '/', '_');
616 } 621 }
617 622
618 } // namespace net 623 } // namespace net
OLDNEW
« no previous file with comments | « net/base/net_util_unittest.cc ('k') | net/base/sdch_manager_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698