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 // PhishingDOMFeatureExtractor handles computing DOM-based features for the | 5 // PhishingDOMFeatureExtractor handles computing DOM-based features for the |
6 // client-side phishing detection model. These include the presence of various | 6 // client-side phishing detection model. These include the presence of various |
7 // types of elements, ratios of external and secure links, and tokens for | 7 // types of elements, ratios of external and secure links, and tokens for |
8 // external domains linked to. | 8 // external domains linked to. |
9 | 9 |
10 #ifndef CHROME_RENDERER_SAFE_BROWSING_PHISHING_DOM_FEATURE_EXTRACTOR_H_ | 10 #ifndef CHROME_RENDERER_SAFE_BROWSING_PHISHING_DOM_FEATURE_EXTRACTOR_H_ |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
99 // builds. | 99 // builds. |
100 void CheckNoPendingExtraction(); | 100 void CheckNoPendingExtraction(); |
101 | 101 |
102 // Runs |done_callback_| and then clears all internal state. | 102 // Runs |done_callback_| and then clears all internal state. |
103 void RunCallback(bool success); | 103 void RunCallback(bool success); |
104 | 104 |
105 // Clears all internal feature extraction state. | 105 // Clears all internal feature extraction state. |
106 void Clear(); | 106 void Clear(); |
107 | 107 |
108 // Called after advancing |cur_document_| to update the state in | 108 // Called after advancing |cur_document_| to update the state in |
109 // |cur_frame_data_|. Returns true if the state was updated successfully. | 109 // |cur_frame_data_|. |
110 bool ResetFrameData(); | 110 void ResetFrameData(); |
111 | 111 |
112 // Returns the next document in frame-traversal order from cur_document_. | 112 // Returns the next document in frame-traversal order from cur_document_. |
113 // If there are no more documents, returns a null WebDocument. | 113 // If there are no more documents, returns a null WebDocument. |
114 WebKit::WebDocument GetNextDocument(); | 114 WebKit::WebDocument GetNextDocument(); |
115 | 115 |
116 // Given a URL, checks whether the domain is different from the domain of | 116 // Given a URL, checks whether the domain is different from the domain of |
117 // the current frame's URL. If so, stores the domain in |domain| and returns | 117 // the current frame's URL. If so, stores the domain in |domain| and returns |
118 // true, otherwise returns false. | 118 // true, otherwise returns false. |
119 bool IsExternalDomain(const GURL& url, std::string* domain) const; | 119 bool IsExternalDomain(const GURL& url, std::string* domain) const; |
120 | 120 |
(...skipping 27 matching lines...) Expand all Loading... |
148 // Used to create ExtractFeaturesWithTimeout tasks. | 148 // Used to create ExtractFeaturesWithTimeout tasks. |
149 // These tasks are revoked if extraction is cancelled. | 149 // These tasks are revoked if extraction is cancelled. |
150 ScopedRunnableMethodFactory<PhishingDOMFeatureExtractor> method_factory_; | 150 ScopedRunnableMethodFactory<PhishingDOMFeatureExtractor> method_factory_; |
151 | 151 |
152 DISALLOW_COPY_AND_ASSIGN(PhishingDOMFeatureExtractor); | 152 DISALLOW_COPY_AND_ASSIGN(PhishingDOMFeatureExtractor); |
153 }; | 153 }; |
154 | 154 |
155 } // namespace safe_browsing | 155 } // namespace safe_browsing |
156 | 156 |
157 #endif // CHROME_RENDERER_SAFE_BROWSING_PHISHING_DOM_FEATURE_EXTRACTOR_H_ | 157 #endif // CHROME_RENDERER_SAFE_BROWSING_PHISHING_DOM_FEATURE_EXTRACTOR_H_ |
OLD | NEW |