| 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 #ifndef CHROME_BROWSER_DOWNLOAD_DOWNLOAD_THROTTLING_RESOURCE_HANDLER_H_ | 5 #ifndef CHROME_BROWSER_DOWNLOAD_DOWNLOAD_THROTTLING_RESOURCE_HANDLER_H_ |
| 6 #define CHROME_BROWSER_DOWNLOAD_DOWNLOAD_THROTTLING_RESOURCE_HANDLER_H_ | 6 #define CHROME_BROWSER_DOWNLOAD_DOWNLOAD_THROTTLING_RESOURCE_HANDLER_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 25 matching lines...) Expand all Loading... |
| 36 net::URLRequest* request, | 36 net::URLRequest* request, |
| 37 const GURL& url, | 37 const GURL& url, |
| 38 int render_process_host_id, | 38 int render_process_host_id, |
| 39 int render_view_id, | 39 int render_view_id, |
| 40 int request_id, | 40 int request_id, |
| 41 bool in_complete); | 41 bool in_complete); |
| 42 | 42 |
| 43 // ResourceHanlder implementation: | 43 // ResourceHanlder implementation: |
| 44 virtual bool OnUploadProgress(int request_id, | 44 virtual bool OnUploadProgress(int request_id, |
| 45 uint64 position, | 45 uint64 position, |
| 46 uint64 size); | 46 uint64 size) OVERRIDE; |
| 47 virtual bool OnRequestRedirected(int request_id, const GURL& url, | 47 virtual bool OnRequestRedirected(int request_id, |
| 48 ResourceResponse* response, bool* defer); | 48 const GURL& url, |
| 49 virtual bool OnResponseStarted(int request_id, ResourceResponse* response); | 49 ResourceResponse* response, |
| 50 virtual bool OnWillStart(int request_id, const GURL& url, bool* defer); | 50 bool* defer) OVERRIDE; |
| 51 virtual bool OnWillRead(int request_id, net::IOBuffer** buf, int* buf_size, | 51 virtual bool OnResponseStarted(int request_id, |
| 52 int min_size); | 52 ResourceResponse* response) OVERRIDE; |
| 53 virtual bool OnReadCompleted(int request_id, int* bytes_read); | 53 virtual bool OnWillStart(int request_id, |
| 54 const GURL& url, |
| 55 bool* defer) OVERRIDE; |
| 56 virtual bool OnWillRead(int request_id, |
| 57 net::IOBuffer** buf, |
| 58 int* buf_size, |
| 59 int min_size) OVERRIDE; |
| 60 virtual bool OnReadCompleted(int request_id, int* bytes_read) OVERRIDE; |
| 54 virtual bool OnResponseCompleted(int request_id, | 61 virtual bool OnResponseCompleted(int request_id, |
| 55 const net::URLRequestStatus& status, | 62 const net::URLRequestStatus& status, |
| 56 const std::string& security_info); | 63 const std::string& security_info) OVERRIDE; |
| 57 virtual void OnRequestClosed(); | 64 virtual void OnRequestClosed() OVERRIDE; |
| 58 | 65 |
| 59 // DownloadRequestLimiter::Callback implementation: | 66 // DownloadRequestLimiter::Callback implementation: |
| 60 virtual void CancelDownload(); | 67 virtual void CancelDownload() OVERRIDE; |
| 61 virtual void ContinueDownload(); | 68 virtual void ContinueDownload() OVERRIDE; |
| 62 | 69 |
| 63 private: | 70 private: |
| 64 virtual ~DownloadThrottlingResourceHandler(); | 71 virtual ~DownloadThrottlingResourceHandler(); |
| 65 | 72 |
| 66 void CopyTmpBufferToDownloadHandler(); | 73 void CopyTmpBufferToDownloadHandler(); |
| 67 | 74 |
| 68 ResourceDispatcherHost* host_; | 75 ResourceDispatcherHost* host_; |
| 69 net::URLRequest* request_; | 76 net::URLRequest* request_; |
| 70 GURL url_; | 77 GURL url_; |
| 71 int render_process_host_id_; | 78 int render_process_host_id_; |
| (...skipping 16 matching lines...) Expand all Loading... |
| 88 int tmp_buffer_length_; | 95 int tmp_buffer_length_; |
| 89 | 96 |
| 90 // Have we received OnRequestClosed()? If so, we shouldn't act on | 97 // Have we received OnRequestClosed()? If so, we shouldn't act on |
| 91 // CancelDownload()/ContinueDownload(). | 98 // CancelDownload()/ContinueDownload(). |
| 92 bool request_closed_; | 99 bool request_closed_; |
| 93 | 100 |
| 94 DISALLOW_COPY_AND_ASSIGN(DownloadThrottlingResourceHandler); | 101 DISALLOW_COPY_AND_ASSIGN(DownloadThrottlingResourceHandler); |
| 95 }; | 102 }; |
| 96 | 103 |
| 97 #endif // CHROME_BROWSER_DOWNLOAD_DOWNLOAD_THROTTLING_RESOURCE_HANDLER_H_ | 104 #endif // CHROME_BROWSER_DOWNLOAD_DOWNLOAD_THROTTLING_RESOURCE_HANDLER_H_ |
| OLD | NEW |