| 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 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 42 static const unsigned int kBlockByType; | 42 static const unsigned int kBlockByType; |
| 43 static const unsigned int kBlockUnsecure; | 43 static const unsigned int kBlockUnsecure; |
| 44 | 44 |
| 45 // Aggregate filter types: | 45 // Aggregate filter types: |
| 46 static const unsigned int kBlockRequest; | 46 static const unsigned int kBlockRequest; |
| 47 static const unsigned int kBlockResponse; | 47 static const unsigned int kBlockResponse; |
| 48 static const unsigned int kModifySentHeaders; | 48 static const unsigned int kModifySentHeaders; |
| 49 static const unsigned int kModifyReceivedHeaders; | 49 static const unsigned int kModifyReceivedHeaders; |
| 50 static const unsigned int kFilterByHeaders; | 50 static const unsigned int kFilterByHeaders; |
| 51 | 51 |
| 52 // Key used to access data attached to URLRequest objects. | |
| 53 static const void* const kRequestDataKey; | |
| 54 | |
| 55 // Converts a stringized filter attribute (see above) back to its integer | 52 // Converts a stringized filter attribute (see above) back to its integer |
| 56 // value. Returns 0 on error. | 53 // value. Returns 0 on error. |
| 57 static unsigned int String2Attribute(const std::string&); | 54 static unsigned int String2Attribute(const std::string&); |
| 58 | 55 |
| 59 // Blacklist entries come from a provider, defined by a name and source URL. | 56 // Blacklist entries come from a provider, defined by a name and source URL. |
| 60 class Provider { | 57 class Provider { |
| 61 public: | 58 public: |
| 62 Provider() {} | 59 Provider() {} |
| 63 Provider(const char* name, const char* url) : name_(name), url_(url) {} | 60 Provider(const char* name, const char* url) : name_(name), url_(url) {} |
| 64 | 61 |
| (...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 191 static bool Matches(const std::string& pattern, const std::string& url); | 188 static bool Matches(const std::string& pattern, const std::string& url); |
| 192 | 189 |
| 193 EntryList blacklist_; | 190 EntryList blacklist_; |
| 194 ProviderList providers_; | 191 ProviderList providers_; |
| 195 | 192 |
| 196 FRIEND_TEST(BlacklistTest, PatternMatch); | 193 FRIEND_TEST(BlacklistTest, PatternMatch); |
| 197 DISALLOW_COPY_AND_ASSIGN(Blacklist); | 194 DISALLOW_COPY_AND_ASSIGN(Blacklist); |
| 198 }; | 195 }; |
| 199 | 196 |
| 200 #endif // CHROME_BROWSER_PRIVACY_BLACKLIST_BLACKLIST_H_ | 197 #endif // CHROME_BROWSER_PRIVACY_BLACKLIST_BLACKLIST_H_ |
| OLD | NEW |