| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/renderer/safe_browsing/phishing_classifier.h" | 5 #include "chrome/renderer/safe_browsing/phishing_classifier.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/callback.h" | 10 #include "base/callback.h" |
| (...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 119 | 119 |
| 120 // Check whether the URL is one that we should classify. | 120 // Check whether the URL is one that we should classify. |
| 121 // Currently, we only classify http: URLs that are GET requests. | 121 // Currently, we only classify http: URLs that are GET requests. |
| 122 GURL url(frame->document().url()); | 122 GURL url(frame->document().url()); |
| 123 if (!url.SchemeIs(url::kHttpScheme)) { | 123 if (!url.SchemeIs(url::kHttpScheme)) { |
| 124 RunFailureCallback(); | 124 RunFailureCallback(); |
| 125 return; | 125 return; |
| 126 } | 126 } |
| 127 | 127 |
| 128 blink::WebDataSource* ds = frame->dataSource(); | 128 blink::WebDataSource* ds = frame->dataSource(); |
| 129 if (!ds || !EqualsASCII(ds->request().httpMethod(), "GET")) { | 129 if (!ds || !base::EqualsASCII(ds->request().httpMethod(), "GET")) { |
| 130 RunFailureCallback(); | 130 RunFailureCallback(); |
| 131 return; | 131 return; |
| 132 } | 132 } |
| 133 | 133 |
| 134 features_.reset(new FeatureMap); | 134 features_.reset(new FeatureMap); |
| 135 if (!url_extractor_->ExtractFeatures(url, features_.get())) { | 135 if (!url_extractor_->ExtractFeatures(url, features_.get())) { |
| 136 RunFailureCallback(); | 136 RunFailureCallback(); |
| 137 return; | 137 return; |
| 138 } | 138 } |
| 139 | 139 |
| (...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 241 } | 241 } |
| 242 | 242 |
| 243 void PhishingClassifier::Clear() { | 243 void PhishingClassifier::Clear() { |
| 244 page_text_ = NULL; | 244 page_text_ = NULL; |
| 245 done_callback_.Reset(); | 245 done_callback_.Reset(); |
| 246 features_.reset(NULL); | 246 features_.reset(NULL); |
| 247 shingle_hashes_.reset(NULL); | 247 shingle_hashes_.reset(NULL); |
| 248 } | 248 } |
| 249 | 249 |
| 250 } // namespace safe_browsing | 250 } // namespace safe_browsing |
| OLD | NEW |