| 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 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 111 | 111 |
| 112 blink::WebFrame* frame = web_view->mainFrame(); | 112 blink::WebFrame* frame = web_view->mainFrame(); |
| 113 if (!frame) { | 113 if (!frame) { |
| 114 RunFailureCallback(); | 114 RunFailureCallback(); |
| 115 return; | 115 return; |
| 116 } | 116 } |
| 117 | 117 |
| 118 // Check whether the URL is one that we should classify. | 118 // Check whether the URL is one that we should classify. |
| 119 // Currently, we only classify http: URLs that are GET requests. | 119 // Currently, we only classify http: URLs that are GET requests. |
| 120 GURL url(frame->document().url()); | 120 GURL url(frame->document().url()); |
| 121 if (!url.SchemeIs(content::kHttpScheme)) { | 121 if (!url.SchemeIs(url::kHttpScheme)) { |
| 122 RunFailureCallback(); | 122 RunFailureCallback(); |
| 123 return; | 123 return; |
| 124 } | 124 } |
| 125 | 125 |
| 126 blink::WebDataSource* ds = frame->dataSource(); | 126 blink::WebDataSource* ds = frame->dataSource(); |
| 127 if (!ds || !EqualsASCII(ds->request().httpMethod(), "GET")) { | 127 if (!ds || !EqualsASCII(ds->request().httpMethod(), "GET")) { |
| 128 RunFailureCallback(); | 128 RunFailureCallback(); |
| 129 return; | 129 return; |
| 130 } | 130 } |
| 131 | 131 |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 232 RunCallback(verdict); | 232 RunCallback(verdict); |
| 233 } | 233 } |
| 234 | 234 |
| 235 void PhishingClassifier::Clear() { | 235 void PhishingClassifier::Clear() { |
| 236 page_text_ = NULL; | 236 page_text_ = NULL; |
| 237 done_callback_.Reset(); | 237 done_callback_.Reset(); |
| 238 features_.reset(NULL); | 238 features_.reset(NULL); |
| 239 } | 239 } |
| 240 | 240 |
| 241 } // namespace safe_browsing | 241 } // namespace safe_browsing |
| OLD | NEW |