| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 #ifndef NET_BASE_SDCH_DICTIONARY_H_ | 5 #ifndef NET_BASE_SDCH_DICTIONARY_H_ |
| 6 #define NET_BASE_SDCH_DICTIONARY_H_ | 6 #define NET_BASE_SDCH_DICTIONARY_H_ |
| 7 | 7 |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 | 9 |
| 10 #include <memory> | 10 #include <memory> |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 60 static SdchProblemCode CanSet(const std::string& domain, | 60 static SdchProblemCode CanSet(const std::string& domain, |
| 61 const std::string& path, | 61 const std::string& path, |
| 62 const std::set<int>& ports, | 62 const std::set<int>& ports, |
| 63 const GURL& dictionary_url); | 63 const GURL& dictionary_url); |
| 64 | 64 |
| 65 // Security method to check if we can use a dictionary to decompress a | 65 // Security method to check if we can use a dictionary to decompress a |
| 66 // target that arrived with a reference to this dictionary. | 66 // target that arrived with a reference to this dictionary. |
| 67 SdchProblemCode CanUse(const GURL& referring_url) const; | 67 SdchProblemCode CanUse(const GURL& referring_url) const; |
| 68 | 68 |
| 69 // Compare paths to see if they "match" for dictionary use. | 69 // Compare paths to see if they "match" for dictionary use. |
| 70 static bool PathMatch(const std::string& path, | 70 static bool PathMatch(const base::StringPiece& path, |
| 71 const std::string& restriction); | 71 const base::StringPiece& restriction); |
| 72 | 72 |
| 73 // Is this dictionary expired? | 73 // Is this dictionary expired? |
| 74 bool Expired() const; | 74 bool Expired() const; |
| 75 | 75 |
| 76 private: | 76 private: |
| 77 friend class base::RefCountedData<SdchDictionary>; | 77 friend class base::RefCountedData<SdchDictionary>; |
| 78 | 78 |
| 79 // Private copy-constructor to support RefCountedData<>, which requires | 79 // Private copy-constructor to support RefCountedData<>, which requires |
| 80 // that an object stored in it be either DefaultConstructible or | 80 // that an object stored in it be either DefaultConstructible or |
| 81 // CopyConstructible | 81 // CopyConstructible |
| (...skipping 21 matching lines...) Expand all Loading... |
| 103 const std::string path_; | 103 const std::string path_; |
| 104 const base::Time expiration_; // Implied by max-age. | 104 const base::Time expiration_; // Implied by max-age. |
| 105 const std::set<int> ports_; | 105 const std::set<int> ports_; |
| 106 | 106 |
| 107 void operator=(const SdchDictionary&) = delete; | 107 void operator=(const SdchDictionary&) = delete; |
| 108 }; | 108 }; |
| 109 | 109 |
| 110 } // namespace net | 110 } // namespace net |
| 111 | 111 |
| 112 #endif // NET_BASE_SDCH_DICTIONARY_H_ | 112 #endif // NET_BASE_SDCH_DICTIONARY_H_ |
| OLD | NEW |