| 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 #include "chrome/browser/privacy_blacklist/blacklist.h" | 5 #include "chrome/browser/privacy_blacklist/blacklist.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <limits> | 8 #include <limits> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 22 matching lines...) Expand all Loading... |
| 33 const unsigned int Blacklist::kBlockUnsecure = 1 << 7; | 33 const unsigned int Blacklist::kBlockUnsecure = 1 << 7; |
| 34 const unsigned int Blacklist::kBlockRequest = kBlockAll | kBlockUnsecure; | 34 const unsigned int Blacklist::kBlockRequest = kBlockAll | kBlockUnsecure; |
| 35 const unsigned int Blacklist::kBlockResponse = kBlockByType; | 35 const unsigned int Blacklist::kBlockResponse = kBlockByType; |
| 36 const unsigned int Blacklist::kModifySentHeaders = | 36 const unsigned int Blacklist::kModifySentHeaders = |
| 37 kDontSendCookies | kDontSendUserAgent | kDontSendReferrer; | 37 kDontSendCookies | kDontSendUserAgent | kDontSendReferrer; |
| 38 const unsigned int Blacklist::kModifyReceivedHeaders = | 38 const unsigned int Blacklist::kModifyReceivedHeaders = |
| 39 kDontPersistCookies | kDontStoreCookies; | 39 kDontPersistCookies | kDontStoreCookies; |
| 40 const unsigned int Blacklist::kFilterByHeaders = | 40 const unsigned int Blacklist::kFilterByHeaders = |
| 41 kModifyReceivedHeaders | kBlockByType; | 41 kModifyReceivedHeaders | kBlockByType; |
| 42 | 42 |
| 43 // Value is not important, here just that the object has an address. | |
| 44 const void* const Blacklist::kRequestDataKey = 0; | |
| 45 | |
| 46 unsigned int Blacklist::String2Attribute(const std::string& s) { | 43 unsigned int Blacklist::String2Attribute(const std::string& s) { |
| 47 if (s == STRINGIZE(kBlockAll)) | 44 if (s == STRINGIZE(kBlockAll)) |
| 48 return kBlockAll; | 45 return kBlockAll; |
| 49 else if (s == STRINGIZE(kDontSendCookies)) | 46 else if (s == STRINGIZE(kDontSendCookies)) |
| 50 return kDontSendCookies; | 47 return kDontSendCookies; |
| 51 else if (s == STRINGIZE(kDontStoreCookies)) | 48 else if (s == STRINGIZE(kDontStoreCookies)) |
| 52 return kDontStoreCookies; | 49 return kDontStoreCookies; |
| 53 else if (s == STRINGIZE(kDontPersistCookies)) | 50 else if (s == STRINGIZE(kDontPersistCookies)) |
| 54 return kDontPersistCookies; | 51 return kDontPersistCookies; |
| 55 else if (s == STRINGIZE(kDontSendReferrer)) | 52 else if (s == STRINGIZE(kDontSendReferrer)) |
| (...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 212 return cookie; | 209 return cookie; |
| 213 | 210 |
| 214 std::string session_cookie(cookie, 0, i); | 211 std::string session_cookie(cookie, 0, i); |
| 215 std::string::size_type end = cookie.find(';', start + 1); | 212 std::string::size_type end = cookie.find(';', start + 1); |
| 216 if (end != std::string::npos) | 213 if (end != std::string::npos) |
| 217 session_cookie.append(cookie.substr(end)); | 214 session_cookie.append(cookie.substr(end)); |
| 218 return session_cookie; | 215 return session_cookie; |
| 219 } | 216 } |
| 220 return cookie; | 217 return cookie; |
| 221 } | 218 } |
| OLD | NEW |