| 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 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 45 public: | 45 public: |
| 46 SafeBrowsingResourceHandler(ResourceHandler* handler, | 46 SafeBrowsingResourceHandler(ResourceHandler* handler, |
| 47 int render_process_host_id, | 47 int render_process_host_id, |
| 48 int render_view_id, | 48 int render_view_id, |
| 49 ResourceType::Type resource_type, | 49 ResourceType::Type resource_type, |
| 50 SafeBrowsingService* safe_browsing, | 50 SafeBrowsingService* safe_browsing, |
| 51 ResourceDispatcherHost* resource_dispatcher_host, | 51 ResourceDispatcherHost* resource_dispatcher_host, |
| 52 ResourceDispatcherHost::Receiver* receiver); | 52 ResourceDispatcherHost::Receiver* receiver); |
| 53 | 53 |
| 54 // ResourceHandler implementation: | 54 // ResourceHandler implementation: |
| 55 bool OnUploadProgress(int request_id, uint64 position, uint64 size); | 55 virtual bool OnUploadProgress(int request_id, uint64 position, uint64 size); |
| 56 bool OnRequestRedirected(int request_id, const GURL& new_url, | 56 virtual bool OnRequestRedirected(int request_id, const GURL& new_url, |
| 57 ResourceResponse* response, bool* defer); | 57 ResourceResponse* response, bool* defer); |
| 58 bool OnResponseStarted(int request_id, ResourceResponse* response); | 58 virtual bool OnResponseStarted(int request_id, ResourceResponse* response); |
| 59 bool OnWillStart(int request_id, const GURL& url, bool* defer); | 59 virtual bool OnWillStart(int request_id, const GURL& url, bool* defer); |
| 60 bool OnWillRead(int request_id, net::IOBuffer** buf, int* buf_size, | 60 virtual bool OnWillRead(int request_id, net::IOBuffer** buf, int* buf_size, |
| 61 int min_size); | 61 int min_size); |
| 62 bool OnReadCompleted(int request_id, int* bytes_read); | 62 virtual bool OnReadCompleted(int request_id, int* bytes_read); |
| 63 bool OnResponseCompleted(int request_id, | 63 virtual bool OnResponseCompleted(int request_id, |
| 64 const URLRequestStatus& status, | 64 const URLRequestStatus& status, |
| 65 const std::string& security_info); | 65 const std::string& security_info); |
| 66 virtual void OnRequestClosed(); | 66 virtual void OnRequestClosed(); |
| 67 | 67 |
| 68 // SafeBrowsingService::Client implementation, called on the IO thread once | 68 // SafeBrowsingService::Client implementation, called on the IO thread once |
| 69 // the URL has been classified. | 69 // the URL has been classified. |
| 70 void OnUrlCheckResult(const GURL& url, | 70 virtual void OnUrlCheckResult(const GURL& url, |
| 71 SafeBrowsingService::UrlCheckResult result); | 71 SafeBrowsingService::UrlCheckResult result); |
| 72 | 72 |
| 73 // SafeBrowsingService::Client implementation, called on the IO thread when | 73 // SafeBrowsingService::Client implementation, called on the IO thread when |
| 74 // the user has decided to proceed with the current request, or go back. | 74 // the user has decided to proceed with the current request, or go back. |
| 75 void OnBlockingPageComplete(bool proceed); | 75 virtual void OnBlockingPageComplete(bool proceed); |
| 76 | 76 |
| 77 // NotificationObserver interface. | 77 // NotificationObserver interface. |
| 78 void Observe(NotificationType type, | 78 virtual void Observe(NotificationType type, |
| 79 const NotificationSource& source, | 79 const NotificationSource& source, |
| 80 const NotificationDetails& details); | 80 const NotificationDetails& details); |
| 81 | 81 |
| 82 private: | 82 private: |
| 83 // Describes what phase of the check a handler is in. | 83 // Describes what phase of the check a handler is in. |
| 84 enum State { | 84 enum State { |
| 85 STATE_NONE, | 85 STATE_NONE, |
| 86 STATE_CHECKING_URL, | 86 STATE_CHECKING_URL, |
| 87 STATE_DISPLAYING_BLOCKING_PAGE, | 87 STATE_DISPLAYING_BLOCKING_PAGE, |
| 88 }; | 88 }; |
| 89 | 89 |
| 90 // Describes what stage of the request got paused by the check. | 90 // Describes what stage of the request got paused by the check. |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 151 int render_view_id_; | 151 int render_view_id_; |
| 152 scoped_refptr<SafeBrowsingService> safe_browsing_; | 152 scoped_refptr<SafeBrowsingService> safe_browsing_; |
| 153 ResourceDispatcherHost* rdh_; | 153 ResourceDispatcherHost* rdh_; |
| 154 ResourceType::Type resource_type_; | 154 ResourceType::Type resource_type_; |
| 155 | 155 |
| 156 DISALLOW_COPY_AND_ASSIGN(SafeBrowsingResourceHandler); | 156 DISALLOW_COPY_AND_ASSIGN(SafeBrowsingResourceHandler); |
| 157 }; | 157 }; |
| 158 | 158 |
| 159 | 159 |
| 160 #endif // CHROME_BROWSER_RENDERER_HOST_SAFE_BROWSING_RESOURCE_HANDLER_H_ | 160 #endif // CHROME_BROWSER_RENDERER_HOST_SAFE_BROWSING_RESOURCE_HANDLER_H_ |
| OLD | NEW |