| 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 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 129 // Currently, we only classify http: URLs that are GET requests. | 129 // Currently, we only classify http: URLs that are GET requests. |
| 130 GURL url(frame->document().url()); | 130 GURL url(frame->document().url()); |
| 131 if (!url.SchemeIs(url::kHttpScheme)) { | 131 if (!url.SchemeIs(url::kHttpScheme)) { |
| 132 RecordReasonForSkippingClassificationToUMA(SKIP_HTTPS); | 132 RecordReasonForSkippingClassificationToUMA(SKIP_HTTPS); |
| 133 RunFailureCallback(); | 133 RunFailureCallback(); |
| 134 return; | 134 return; |
| 135 } | 135 } |
| 136 | 136 |
| 137 blink::WebDataSource* ds = frame->dataSource(); | 137 blink::WebDataSource* ds = frame->dataSource(); |
| 138 if (!ds || | 138 if (!ds || |
| 139 !base::EqualsASCII(base::StringPiece16(ds->request().httpMethod()), | 139 !base::EqualsASCII(base::StringPiece16(ds->getRequest().httpMethod()), |
| 140 "GET")) { | 140 "GET")) { |
| 141 if (ds) | 141 if (ds) |
| 142 RecordReasonForSkippingClassificationToUMA(SKIP_NONE_GET); | 142 RecordReasonForSkippingClassificationToUMA(SKIP_NONE_GET); |
| 143 RunFailureCallback(); | 143 RunFailureCallback(); |
| 144 return; | 144 return; |
| 145 } | 145 } |
| 146 | 146 |
| 147 RecordReasonForSkippingClassificationToUMA(CLASSIFICATION_PROCEED); | 147 RecordReasonForSkippingClassificationToUMA(CLASSIFICATION_PROCEED); |
| 148 features_.reset(new FeatureMap); | 148 features_.reset(new FeatureMap); |
| 149 if (!url_extractor_->ExtractFeatures(url, features_.get())) { | 149 if (!url_extractor_->ExtractFeatures(url, features_.get())) { |
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 244 } | 244 } |
| 245 | 245 |
| 246 void PhishingClassifier::Clear() { | 246 void PhishingClassifier::Clear() { |
| 247 page_text_ = NULL; | 247 page_text_ = NULL; |
| 248 done_callback_.Reset(); | 248 done_callback_.Reset(); |
| 249 features_.reset(NULL); | 249 features_.reset(NULL); |
| 250 shingle_hashes_.reset(NULL); | 250 shingle_hashes_.reset(NULL); |
| 251 } | 251 } |
| 252 | 252 |
| 253 } // namespace safe_browsing | 253 } // namespace safe_browsing |
| OLD | NEW |