| 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 28 matching lines...) Expand all Loading... |
| 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) OVERRIDE; | 46 uint64 size) OVERRIDE; |
| 47 virtual bool OnRequestRedirected(int request_id, | 47 virtual bool OnRequestRedirected(int request_id, |
| 48 const GURL& url, | 48 const GURL& url, |
| 49 ResourceResponse* response, | 49 content::ResourceResponse* response, |
| 50 bool* defer) OVERRIDE; | 50 bool* defer) OVERRIDE; |
| 51 virtual bool OnResponseStarted(int request_id, | 51 virtual bool OnResponseStarted(int request_id, |
| 52 ResourceResponse* response) OVERRIDE; | 52 content::ResourceResponse* response) OVERRIDE; |
| 53 virtual bool OnWillStart(int request_id, | 53 virtual bool OnWillStart(int request_id, |
| 54 const GURL& url, | 54 const GURL& url, |
| 55 bool* defer) OVERRIDE; | 55 bool* defer) OVERRIDE; |
| 56 virtual bool OnWillRead(int request_id, | 56 virtual bool OnWillRead(int request_id, |
| 57 net::IOBuffer** buf, | 57 net::IOBuffer** buf, |
| 58 int* buf_size, | 58 int* buf_size, |
| 59 int min_size) OVERRIDE; | 59 int min_size) OVERRIDE; |
| 60 virtual bool OnReadCompleted(int request_id, int* bytes_read) OVERRIDE; | 60 virtual bool OnReadCompleted(int request_id, int* bytes_read) OVERRIDE; |
| 61 virtual bool OnResponseCompleted(int request_id, | 61 virtual bool OnResponseCompleted(int request_id, |
| 62 const net::URLRequestStatus& status, | 62 const net::URLRequestStatus& status, |
| (...skipping 17 matching lines...) Expand all Loading... |
| 80 int request_id_; | 80 int request_id_; |
| 81 | 81 |
| 82 // The original handler. | 82 // The original handler. |
| 83 scoped_refptr<ResourceHandler> next_handler_; | 83 scoped_refptr<ResourceHandler> next_handler_; |
| 84 | 84 |
| 85 // Set to true when we know that the request is allowed to start. | 85 // Set to true when we know that the request is allowed to start. |
| 86 bool request_allowed_; | 86 bool request_allowed_; |
| 87 | 87 |
| 88 // Response supplied to OnResponseStarted. Only non-null if OnResponseStarted | 88 // Response supplied to OnResponseStarted. Only non-null if OnResponseStarted |
| 89 // is invoked. | 89 // is invoked. |
| 90 scoped_refptr<ResourceResponse> response_; | 90 scoped_refptr<content::ResourceResponse> response_; |
| 91 | 91 |
| 92 // If we're created by way of BufferedEventHandler we'll get one request for | 92 // If we're created by way of BufferedEventHandler we'll get one request for |
| 93 // a buffer. This is that buffer. | 93 // a buffer. This is that buffer. |
| 94 scoped_refptr<net::IOBuffer> tmp_buffer_; | 94 scoped_refptr<net::IOBuffer> tmp_buffer_; |
| 95 int tmp_buffer_length_; | 95 int tmp_buffer_length_; |
| 96 | 96 |
| 97 // Have we received OnRequestClosed()? If so, we shouldn't act on | 97 // Have we received OnRequestClosed()? If so, we shouldn't act on |
| 98 // CancelDownload()/ContinueDownload(). | 98 // CancelDownload()/ContinueDownload(). |
| 99 bool request_closed_; | 99 bool request_closed_; |
| 100 | 100 |
| 101 DISALLOW_COPY_AND_ASSIGN(DownloadThrottlingResourceHandler); | 101 DISALLOW_COPY_AND_ASSIGN(DownloadThrottlingResourceHandler); |
| 102 }; | 102 }; |
| 103 | 103 |
| 104 #endif // CHROME_BROWSER_DOWNLOAD_DOWNLOAD_THROTTLING_RESOURCE_HANDLER_H_ | 104 #endif // CHROME_BROWSER_DOWNLOAD_DOWNLOAD_THROTTLING_RESOURCE_HANDLER_H_ |
| OLD | NEW |