Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 CHROME_BROWSER_PRIVACY_BLACKLIST_BLACKLIST_H_ | 5 #ifndef CHROME_BROWSER_PRIVACY_BLACKLIST_BLACKLIST_H_ |
| 6 #define CHROME_BROWSER_PRIVACY_BLACKLIST_BLACKLIST_H_ | 6 #define CHROME_BROWSER_PRIVACY_BLACKLIST_BLACKLIST_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 166 return providers_.begin(); | 166 return providers_.begin(); |
| 167 } | 167 } |
| 168 | 168 |
| 169 ProviderList::const_iterator providers_end() const { | 169 ProviderList::const_iterator providers_end() const { |
| 170 return providers_.end(); | 170 return providers_.end(); |
| 171 } | 171 } |
| 172 | 172 |
| 173 // Returns a pointer to a Match structure holding all matching entries. | 173 // Returns a pointer to a Match structure holding all matching entries. |
| 174 // If no matching Entry is found, returns null. Ownership belongs to the | 174 // If no matching Entry is found, returns null. Ownership belongs to the |
| 175 // caller. | 175 // caller. |
| 176 Match* findMatch(const GURL&) const; | 176 Match* FindMatch(const GURL&) const; |
| 177 | 177 |
| 178 // Helper to remove cookies from a header. | 178 // Helper to remove cookies from a header. |
| 179 static std::string StripCookies(const std::string&); | 179 static std::string StripCookies(const std::string&); |
| 180 | 180 |
| 181 // Helper to remove cookie expiration from a header. | 181 // Helper to remove cookie expiration from a header. |
| 182 static std::string StripCookieExpiry(const std::string&); | 182 static std::string StripCookieExpiry(const std::string&); |
| 183 | 183 |
| 184 private: | 184 private: |
| 185 // Converts a GURL into the string to match against. | |
| 186 static std::string GetURLAsString(const GURL& url); | |
|
brettw
2010/01/12 15:53:51
I'd suggest a name a little more specific. The pro
jochen (gone - plz use gerrit)
2010/01/12 16:30:19
Done.
| |
| 187 | |
| 185 // Matches a pattern to a core URL which is host/path with all the other | 188 // Matches a pattern to a core URL which is host/path with all the other |
| 186 // optional parts (scheme, user, password, port) stripped away. Used only | 189 // optional parts (scheme, user, password, port) stripped away. |
| 187 // internally but made static so that access can be given to tests. | |
| 188 static bool Matches(const std::string& pattern, const std::string& url); | 190 static bool Matches(const std::string& pattern, const std::string& url); |
| 189 | 191 |
| 190 EntryList blacklist_; | 192 EntryList blacklist_; |
| 191 ProviderList providers_; | 193 ProviderList providers_; |
| 192 | 194 |
| 195 FRIEND_TEST(BlacklistTest, Generic); | |
| 193 FRIEND_TEST(BlacklistTest, PatternMatch); | 196 FRIEND_TEST(BlacklistTest, PatternMatch); |
| 194 DISALLOW_COPY_AND_ASSIGN(Blacklist); | 197 DISALLOW_COPY_AND_ASSIGN(Blacklist); |
| 195 }; | 198 }; |
| 196 | 199 |
| 197 #endif // CHROME_BROWSER_PRIVACY_BLACKLIST_BLACKLIST_H_ | 200 #endif // CHROME_BROWSER_PRIVACY_BLACKLIST_BLACKLIST_H_ |
| OLD | NEW |