| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/safe_browsing/browser_feature_extractor.h" | 5 #include "chrome/browser/safe_browsing/browser_feature_extractor.h" |
| 6 | 6 |
| 7 #include <map> | 7 #include <map> |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 111 1.0, | 111 1.0, |
| 112 request); | 112 request); |
| 113 return; | 113 return; |
| 114 } | 114 } |
| 115 // We skip the last element since it should just be the current url. | 115 // We skip the last element since it should just be the current url. |
| 116 for (size_t i = 0; i < redirect_chain.size() - 1; i++) { | 116 for (size_t i = 0; i < redirect_chain.size() - 1; i++) { |
| 117 std::string printable_redirect = redirect_chain[i].spec(); | 117 std::string printable_redirect = redirect_chain[i].spec(); |
| 118 if (redirect_chain[i].SchemeIsSecure()) { | 118 if (redirect_chain[i].SchemeIsSecure()) { |
| 119 printable_redirect = features::kSecureRedirectValue; | 119 printable_redirect = features::kSecureRedirectValue; |
| 120 } | 120 } |
| 121 AddFeature(base::StringPrintf("%s%s[%"PRIuS"]=%s", | 121 AddFeature(base::StringPrintf("%s%s[%" PRIuS "]=%s", |
| 122 feature_prefix.c_str(), | 122 feature_prefix.c_str(), |
| 123 features::kRedirect, | 123 features::kRedirect, |
| 124 i, | 124 i, |
| 125 printable_redirect.c_str()), | 125 printable_redirect.c_str()), |
| 126 1.0, | 126 1.0, |
| 127 request); | 127 request); |
| 128 } | 128 } |
| 129 } | 129 } |
| 130 | 130 |
| 131 BrowserFeatureExtractor::BrowserFeatureExtractor( | 131 BrowserFeatureExtractor::BrowserFeatureExtractor( |
| (...skipping 348 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 480 Profile::EXPLICIT_ACCESS); | 480 Profile::EXPLICIT_ACCESS); |
| 481 if (*history) { | 481 if (*history) { |
| 482 return true; | 482 return true; |
| 483 } | 483 } |
| 484 } | 484 } |
| 485 VLOG(2) << "Unable to query history. No history service available."; | 485 VLOG(2) << "Unable to query history. No history service available."; |
| 486 return false; | 486 return false; |
| 487 } | 487 } |
| 488 | 488 |
| 489 } // namespace safe_browsing | 489 } // namespace safe_browsing |
| OLD | NEW |