| 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 203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 214 if (first_host_index != -1) { | 214 if (first_host_index != -1) { |
| 215 AddNavigationFeatures(features::kHostPrefix, | 215 AddNavigationFeatures(features::kHostPrefix, |
| 216 controller, | 216 controller, |
| 217 first_host_index, | 217 first_host_index, |
| 218 info->host_redirects, | 218 info->host_redirects, |
| 219 request); | 219 request); |
| 220 } | 220 } |
| 221 | 221 |
| 222 ExtractBrowseInfoFeatures(*info, request); | 222 ExtractBrowseInfoFeatures(*info, request); |
| 223 pending_extractions_[request] = callback; | 223 pending_extractions_[request] = callback; |
| 224 MessageLoop::current()->PostTask( | 224 base::MessageLoop::current()->PostTask( |
| 225 FROM_HERE, | 225 FROM_HERE, |
| 226 base::Bind(&BrowserFeatureExtractor::StartExtractFeatures, | 226 base::Bind(&BrowserFeatureExtractor::StartExtractFeatures, |
| 227 weak_factory_.GetWeakPtr(), request, callback)); | 227 weak_factory_.GetWeakPtr(), |
| 228 request, |
| 229 callback)); |
| 228 } | 230 } |
| 229 | 231 |
| 230 void BrowserFeatureExtractor::ExtractMalwareFeatures( | 232 void BrowserFeatureExtractor::ExtractMalwareFeatures( |
| 231 const BrowseInfo* info, | 233 const BrowseInfo* info, |
| 232 ClientMalwareRequest* request) { | 234 ClientMalwareRequest* request) { |
| 233 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 235 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 234 DCHECK(request); | 236 DCHECK(request); |
| 235 DCHECK(info); | 237 DCHECK(info); |
| 236 DCHECK_EQ(0U, request->url().find("http:")); | 238 DCHECK_EQ(0U, request->url().find("http:")); |
| 237 // get the IPs and hosts that match the malware blacklisted IP list. | 239 // get the IPs and hosts that match the malware blacklisted IP list. |
| (...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 480 Profile::EXPLICIT_ACCESS); | 482 Profile::EXPLICIT_ACCESS); |
| 481 if (*history) { | 483 if (*history) { |
| 482 return true; | 484 return true; |
| 483 } | 485 } |
| 484 } | 486 } |
| 485 VLOG(2) << "Unable to query history. No history service available."; | 487 VLOG(2) << "Unable to query history. No history service available."; |
| 486 return false; | 488 return false; |
| 487 } | 489 } |
| 488 | 490 |
| 489 } // namespace safe_browsing | 491 } // namespace safe_browsing |
| OLD | NEW |