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

Side by Side Diff: net/base/sdch_dictionary.h

Issue 1876683002: Implement SDCH Dictionary domain matching as per RFC 2965 Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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 | « no previous file | net/base/sdch_dictionary.cc » ('j') | net/base/sdch_dictionary.cc » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 <set> 10 #include <set>
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
59 // given data, that arrived in response to get of dictionary_url. 59 // given data, that arrived in response to get of dictionary_url.
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 domains to see if they "match" for dictionary use.
70 static bool DomainMatch(const GURL& url, const std::string& restriction);
71
69 // Compare paths to see if they "match" for dictionary use. 72 // Compare paths to see if they "match" for dictionary use.
70 static bool PathMatch(const std::string& path, 73 static bool PathMatch(const std::string& path,
71 const std::string& restriction); 74 const std::string& restriction);
72 75
73 // Is this dictionary expired? 76 // Is this dictionary expired?
74 bool Expired() const; 77 bool Expired() const;
75 78
76 private: 79 private:
77 friend class base::RefCountedData<SdchDictionary>; 80 friend class base::RefCountedData<SdchDictionary>;
78 81
(...skipping 24 matching lines...) Expand all
103 const std::string path_; 106 const std::string path_;
104 const base::Time expiration_; // Implied by max-age. 107 const base::Time expiration_; // Implied by max-age.
105 const std::set<int> ports_; 108 const std::set<int> ports_;
106 109
107 void operator=(const SdchDictionary&) = delete; 110 void operator=(const SdchDictionary&) = delete;
108 }; 111 };
109 112
110 } // namespace net 113 } // namespace net
111 114
112 #endif // NET_BASE_SDCH_DICTIONARY_H_ 115 #endif // NET_BASE_SDCH_DICTIONARY_H_
OLDNEW
« no previous file with comments | « no previous file | net/base/sdch_dictionary.cc » ('j') | net/base/sdch_dictionary.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698