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 // 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 is used to fetch the client-side | 6 // client-side phishing detection. This class is used to fetch the client-side |
7 // model and send it to all renderers. This class is also used to send a ping | 7 // model and send it to all renderers. This class is also used to send a ping |
8 // back to Google to verify if a particular site is really phishing or not. | 8 // back to 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 be made on the UI | 10 // This class is not thread-safe and expects all calls to be made on the UI |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
67 | 67 |
68 // From the URLFetcher::Delegate interface. | 68 // From the URLFetcher::Delegate interface. |
69 virtual void OnURLFetchComplete(const URLFetcher* source, | 69 virtual void OnURLFetchComplete(const URLFetcher* source, |
70 const GURL& url, | 70 const GURL& url, |
71 const net::URLRequestStatus& status, | 71 const net::URLRequestStatus& status, |
72 int response_code, | 72 int response_code, |
73 const net::ResponseCookies& cookies, | 73 const net::ResponseCookies& cookies, |
74 const std::string& data); | 74 const std::string& data); |
75 | 75 |
76 // NotificationObserver overrides: | 76 // NotificationObserver overrides: |
77 virtual void Observe(NotificationType type, | 77 virtual void Observe(int type, |
78 const NotificationSource& source, | 78 const NotificationSource& source, |
79 const NotificationDetails& details); | 79 const NotificationDetails& details); |
80 | 80 |
81 // Sends a request to the SafeBrowsing servers with the ClientPhishingRequest. | 81 // Sends a request to the SafeBrowsing servers with the ClientPhishingRequest. |
82 // The URL scheme of the |url()| in the request should be HTTP. This method | 82 // The URL scheme of the |url()| in the request should be HTTP. This method |
83 // takes ownership of the |verdict| as well as the |callback| and calls the | 83 // takes ownership of the |verdict| as well as the |callback| and calls the |
84 // the callback once the result has come back from the server or if an error | 84 // the callback once the result has come back from the server or if an error |
85 // occurs during the fetch. If an error occurs the phishing verdict will | 85 // occurs during the fetch. If an error occurs the phishing verdict will |
86 // always be false. The callback is always called after | 86 // always be false. The callback is always called after |
87 // SendClientReportPhishingRequest() returns and on the same thread as | 87 // SendClientReportPhishingRequest() returns and on the same thread as |
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
261 // this map to speed up lookups. | 261 // this map to speed up lookups. |
262 BadSubnetMap bad_subnets_; | 262 BadSubnetMap bad_subnets_; |
263 | 263 |
264 NotificationRegistrar registrar_; | 264 NotificationRegistrar registrar_; |
265 | 265 |
266 DISALLOW_COPY_AND_ASSIGN(ClientSideDetectionService); | 266 DISALLOW_COPY_AND_ASSIGN(ClientSideDetectionService); |
267 }; | 267 }; |
268 } // namepsace safe_browsing | 268 } // namepsace safe_browsing |
269 | 269 |
270 #endif // CHROME_BROWSER_SAFE_BROWSING_CLIENT_SIDE_DETECTION_SERVICE_H_ | 270 #endif // CHROME_BROWSER_SAFE_BROWSING_CLIENT_SIDE_DETECTION_SERVICE_H_ |
OLD | NEW |