| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_RESOURCE_HANDLER_H_ | 5 #ifndef CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_RESOURCE_HANDLER_H_ |
| 6 #define CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_RESOURCE_HANDLER_H_ | 6 #define CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_RESOURCE_HANDLER_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 64 const GURL& url, | 64 const GURL& url, |
| 65 bool* defer) OVERRIDE; | 65 bool* defer) OVERRIDE; |
| 66 | 66 |
| 67 // Create a new buffer, which will be handed to the download thread for file | 67 // Create a new buffer, which will be handed to the download thread for file |
| 68 // writing and deletion. | 68 // writing and deletion. |
| 69 virtual bool OnWillRead(int request_id, | 69 virtual bool OnWillRead(int request_id, |
| 70 net::IOBuffer** buf, | 70 net::IOBuffer** buf, |
| 71 int* buf_size, | 71 int* buf_size, |
| 72 int min_size) OVERRIDE; | 72 int min_size) OVERRIDE; |
| 73 | 73 |
| 74 virtual bool OnReadCompleted(int request_id, int* bytes_read, | 74 virtual bool OnReadCompleted(int request_id, int bytes_read, |
| 75 bool* defer) OVERRIDE; | 75 bool* defer) OVERRIDE; |
| 76 | 76 |
| 77 virtual bool OnResponseCompleted(int request_id, | 77 virtual bool OnResponseCompleted(int request_id, |
| 78 const net::URLRequestStatus& status, | 78 const net::URLRequestStatus& status, |
| 79 const std::string& security_info) OVERRIDE; | 79 const std::string& security_info) OVERRIDE; |
| 80 | 80 |
| 81 void PauseRequest(); | 81 void PauseRequest(); |
| 82 void ResumeRequest(); | 82 void ResumeRequest(); |
| 83 void CancelRequest(); | 83 void CancelRequest(); |
| 84 | 84 |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 128 // For DCHECKing | 128 // For DCHECKing |
| 129 bool on_response_started_called_; | 129 bool on_response_started_called_; |
| 130 | 130 |
| 131 static const int kReadBufSize = 32768; // bytes | 131 static const int kReadBufSize = 32768; // bytes |
| 132 static const int kThrottleTimeMs = 200; // milliseconds | 132 static const int kThrottleTimeMs = 200; // milliseconds |
| 133 | 133 |
| 134 DISALLOW_COPY_AND_ASSIGN(DownloadResourceHandler); | 134 DISALLOW_COPY_AND_ASSIGN(DownloadResourceHandler); |
| 135 }; | 135 }; |
| 136 | 136 |
| 137 #endif // CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_RESOURCE_HANDLER_H_ | 137 #endif // CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_RESOURCE_HANDLER_H_ |
| OLD | NEW |