| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 104 | 104 |
| 105 private: | 105 private: |
| 106 friend class SdchManager; // Only manager can construct an instance. | 106 friend class SdchManager; // Only manager can construct an instance. |
| 107 | 107 |
| 108 // Construct a vc-diff usable dictionary from the dictionary_text starting | 108 // Construct a vc-diff usable dictionary from the dictionary_text starting |
| 109 // at the given offset. The supplied client_hash should be used to | 109 // at the given offset. The supplied client_hash should be used to |
| 110 // advertise the dictionary's availability relative to the suppplied URL. | 110 // advertise the dictionary's availability relative to the suppplied URL. |
| 111 Dictionary(const std::string& dictionary_text, size_t offset, | 111 Dictionary(const std::string& dictionary_text, size_t offset, |
| 112 const std::string& client_hash, const GURL& url, | 112 const std::string& client_hash, const GURL& url, |
| 113 const std::string& domain, const std::string& path, | 113 const std::string& domain, const std::string& path, |
| 114 const Time& expiration, const std::set<int> ports); | 114 const base::Time& expiration, const std::set<int> ports); |
| 115 | 115 |
| 116 const GURL& url() const { return url_; } | 116 const GURL& url() const { return url_; } |
| 117 const std::string& client_hash() const { return client_hash_; } | 117 const std::string& client_hash() const { return client_hash_; } |
| 118 | 118 |
| 119 // Security method to check if we can advertise this dictionary for use | 119 // Security method to check if we can advertise this dictionary for use |
| 120 // if the |target_url| returns SDCH compressed data. | 120 // if the |target_url| returns SDCH compressed data. |
| 121 bool CanAdvertise(const GURL& target_url); | 121 bool CanAdvertise(const GURL& target_url); |
| 122 | 122 |
| 123 // Security methods to check if we can establish a new dictionary with the | 123 // Security methods to check if we can establish a new dictionary with the |
| 124 // given data, that arrived in response to get of dictionary_url. | 124 // given data, that arrived in response to get of dictionary_url. |
| (...skipping 21 matching lines...) Expand all Loading... |
| 146 | 146 |
| 147 // The GURL that arrived with the text_ in a URL request to specify where | 147 // The GURL that arrived with the text_ in a URL request to specify where |
| 148 // this dictionary may be used. | 148 // this dictionary may be used. |
| 149 const GURL url_; | 149 const GURL url_; |
| 150 | 150 |
| 151 // Metadate "headers" in before dictionary text contained the following: | 151 // Metadate "headers" in before dictionary text contained the following: |
| 152 // Each dictionary payload consists of several headers, followed by the text | 152 // Each dictionary payload consists of several headers, followed by the text |
| 153 // of the dictionary. The following are the known headers. | 153 // of the dictionary. The following are the known headers. |
| 154 const std::string domain_; | 154 const std::string domain_; |
| 155 const std::string path_; | 155 const std::string path_; |
| 156 const Time expiration_; // Implied by max-age. | 156 const base::Time expiration_; // Implied by max-age. |
| 157 const std::set<int> ports_; | 157 const std::set<int> ports_; |
| 158 | 158 |
| 159 DISALLOW_COPY_AND_ASSIGN(Dictionary); | 159 DISALLOW_COPY_AND_ASSIGN(Dictionary); |
| 160 }; | 160 }; |
| 161 | 161 |
| 162 SdchManager(); | 162 SdchManager(); |
| 163 ~SdchManager(); | 163 ~SdchManager(); |
| 164 | 164 |
| 165 // Provide access to the single instance of this class. | 165 // Provide access to the single instance of this class. |
| 166 static SdchManager* Global(); | 166 static SdchManager* Global(); |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 249 // domain is supported. | 249 // domain is supported. |
| 250 std::string supported_domain_; | 250 std::string supported_domain_; |
| 251 | 251 |
| 252 // List domains where decode failures have required disabling sdch. | 252 // List domains where decode failures have required disabling sdch. |
| 253 std::set<std::string> blacklisted_domains_; | 253 std::set<std::string> blacklisted_domains_; |
| 254 | 254 |
| 255 DISALLOW_COPY_AND_ASSIGN(SdchManager); | 255 DISALLOW_COPY_AND_ASSIGN(SdchManager); |
| 256 }; | 256 }; |
| 257 | 257 |
| 258 #endif // NET_BASE_SDCH_MANAGER_H_ | 258 #endif // NET_BASE_SDCH_MANAGER_H_ |
| OLD | NEW |