| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 #ifndef CHROME_BROWSER_RENDERER_HOST_SAFE_BROWSING_RESOURCE_HANDLER_H_ | 5 #ifndef CHROME_BROWSER_RENDERER_HOST_SAFE_BROWSING_RESOURCE_HANDLER_H_ |
| 6 #define CHROME_BROWSER_RENDERER_HOST_SAFE_BROWSING_RESOURCE_HANDLER_H_ | 6 #define CHROME_BROWSER_RENDERER_HOST_SAFE_BROWSING_RESOURCE_HANDLER_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/time.h" | 10 #include "base/time.h" |
| 11 #include "chrome/browser/renderer_host/resource_handler.h" | 11 #include "chrome/browser/renderer_host/resource_handler.h" |
| 12 #include "chrome/browser/safe_browsing/safe_browsing_service.h" | 12 #include "chrome/browser/safe_browsing/safe_browsing_service.h" |
| 13 | 13 |
| 14 class ResourceDispatcherHost; | 14 class ResourceDispatcherHost; |
| 15 | 15 |
| 16 // Checks that a url is safe. | 16 // Checks that a url is safe. |
| 17 class SafeBrowsingResourceHandler : public ResourceHandler, | 17 class SafeBrowsingResourceHandler : public ResourceHandler, |
| 18 public SafeBrowsingService::Client { | 18 public SafeBrowsingService::Client { |
| 19 public: | 19 public: |
| 20 SafeBrowsingResourceHandler(ResourceHandler* handler, | 20 SafeBrowsingResourceHandler(ResourceHandler* handler, |
| 21 int render_process_host_id, | 21 int render_process_host_id, |
| 22 int render_view_id, | 22 int render_view_id, |
| 23 const GURL& url, | 23 const GURL& url, |
| 24 ResourceType::Type resource_type, | 24 ResourceType::Type resource_type, |
| 25 SafeBrowsingService* safe_browsing, | 25 SafeBrowsingService* safe_browsing, |
| 26 ResourceDispatcherHost* resource_dispatcher_host); | 26 ResourceDispatcherHost* resource_dispatcher_host); |
| 27 ~SafeBrowsingResourceHandler(); |
| 27 | 28 |
| 28 // ResourceHandler implementation: | 29 // ResourceHandler implementation: |
| 29 bool OnUploadProgress(int request_id, uint64 position, uint64 size); | 30 bool OnUploadProgress(int request_id, uint64 position, uint64 size); |
| 30 bool OnRequestRedirected(int request_id, const GURL& new_url); | 31 bool OnRequestRedirected(int request_id, const GURL& new_url); |
| 31 bool OnResponseStarted(int request_id, ResourceResponse* response); | 32 bool OnResponseStarted(int request_id, ResourceResponse* response); |
| 32 void OnGetHashTimeout(); | 33 void OnGetHashTimeout(); |
| 33 bool OnWillRead(int request_id, net::IOBuffer** buf, int* buf_size, | 34 bool OnWillRead(int request_id, net::IOBuffer** buf, int* buf_size, |
| 34 int min_size); | 35 int min_size); |
| 35 bool OnReadCompleted(int request_id, int* bytes_read); | 36 bool OnReadCompleted(int request_id, int* bytes_read); |
| 36 bool OnResponseCompleted(int request_id, | 37 bool OnResponseCompleted(int request_id, |
| (...skipping 23 matching lines...) Expand all Loading... |
| 60 int queued_error_request_id_; | 61 int queued_error_request_id_; |
| 61 ResourceDispatcherHost* rdh_; | 62 ResourceDispatcherHost* rdh_; |
| 62 base::Time pause_time_; | 63 base::Time pause_time_; |
| 63 ResourceType::Type resource_type_; | 64 ResourceType::Type resource_type_; |
| 64 | 65 |
| 65 DISALLOW_COPY_AND_ASSIGN(SafeBrowsingResourceHandler); | 66 DISALLOW_COPY_AND_ASSIGN(SafeBrowsingResourceHandler); |
| 66 }; | 67 }; |
| 67 | 68 |
| 68 | 69 |
| 69 #endif // CHROME_BROWSER_RENDERER_HOST_SAFE_BROWSING_RESOURCE_HANDLER_H_ | 70 #endif // CHROME_BROWSER_RENDERER_HOST_SAFE_BROWSING_RESOURCE_HANDLER_H_ |
| OLD | NEW |