OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 // Helper class which handles communication with the SafeBrowsing backends for | 5 // Helper class which handles communication with the SafeBrowsing backends for |
6 // client-side phishing detection. This class can be used to get a file | 6 // client-side phishing detection. This class can be used to get a file |
7 // descriptor to the client-side phishing model and also to send a ping back to | 7 // descriptor to the client-side phishing model and also to send a ping back to |
8 // Google to verify if a particular site is really phishing or not. | 8 // Google to verify if a particular site is really phishing or not. |
9 // | 9 // |
10 // This class is not thread-safe and expects all calls to GetModelFile() and | 10 // This class is not thread-safe and expects all calls to GetModelFile() and |
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
163 void HandlePhishingVerdict(const URLFetcher* source, | 163 void HandlePhishingVerdict(const URLFetcher* source, |
164 const GURL& url, | 164 const GURL& url, |
165 const URLRequestStatus& status, | 165 const URLRequestStatus& status, |
166 int response_code, | 166 int response_code, |
167 const ResponseCookies& cookies, | 167 const ResponseCookies& cookies, |
168 const std::string& data); | 168 const std::string& data); |
169 | 169 |
170 FilePath model_path_; | 170 FilePath model_path_; |
171 ModelStatus model_status_; | 171 ModelStatus model_status_; |
172 base::PlatformFile model_file_; | 172 base::PlatformFile model_file_; |
173 scoped_ptr<URLFetcher> model_fetcher_; | 173 URLFetcher* model_fetcher_; |
174 scoped_ptr<std::string> tmp_model_string_; | 174 scoped_ptr<std::string> tmp_model_string_; |
175 std::vector<OpenModelDoneCallback*> open_callbacks_; | 175 std::vector<OpenModelDoneCallback*> open_callbacks_; |
176 | 176 |
177 // Map of client report phishing request to the corresponding callback that | 177 // Map of client report phishing request to the corresponding callback that |
178 // has to be invoked when the request is done. | 178 // has to be invoked when the request is done. |
179 std::map<const URLFetcher*, ClientReportInfo*> client_phishing_reports_; | 179 std::map<const URLFetcher*, ClientReportInfo*> client_phishing_reports_; |
180 | 180 |
181 // Used to asynchronously call the callbacks for GetModelFile and | 181 // Used to asynchronously call the callbacks for GetModelFile and |
182 // SendClientReportPhishingRequest. | 182 // SendClientReportPhishingRequest. |
183 ScopedRunnableMethodFactory<ClientSideDetectionService> method_factory_; | 183 ScopedRunnableMethodFactory<ClientSideDetectionService> method_factory_; |
184 | 184 |
185 // The context we use to issue network requests. | 185 // The context we use to issue network requests. |
186 scoped_refptr<URLRequestContextGetter> request_context_getter_; | 186 scoped_refptr<URLRequestContextGetter> request_context_getter_; |
187 | 187 |
188 DISALLOW_COPY_AND_ASSIGN(ClientSideDetectionService); | 188 DISALLOW_COPY_AND_ASSIGN(ClientSideDetectionService); |
189 }; | 189 }; |
190 | 190 |
191 } // namepsace safe_browsing | 191 } // namepsace safe_browsing |
192 | 192 |
193 #endif // CHROME_BROWSER_SAFE_BROWSING_CLIENT_SIDE_DETECTION_SERVICE_H_ | 193 #endif // CHROME_BROWSER_SAFE_BROWSING_CLIENT_SIDE_DETECTION_SERVICE_H_ |
OLD | NEW |