| 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 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 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 107 int64 content_length_; | 107 int64 content_length_; |
| 108 DownloadFileManager* download_file_manager_; | 108 DownloadFileManager* download_file_manager_; |
| 109 net::URLRequest* request_; | 109 net::URLRequest* request_; |
| 110 bool save_as_; // Request was initiated via "Save As" by the user. | 110 bool save_as_; // Request was initiated via "Save As" by the user. |
| 111 OnStartedCallback started_cb_; | 111 OnStartedCallback started_cb_; |
| 112 DownloadSaveInfo save_info_; | 112 DownloadSaveInfo save_info_; |
| 113 scoped_refptr<content::DownloadBuffer> buffer_; | 113 scoped_refptr<content::DownloadBuffer> buffer_; |
| 114 ResourceDispatcherHost* rdh_; | 114 ResourceDispatcherHost* rdh_; |
| 115 bool is_paused_; | 115 bool is_paused_; |
| 116 base::OneShotTimer<DownloadResourceHandler> pause_timer_; | 116 base::OneShotTimer<DownloadResourceHandler> pause_timer_; |
| 117 base::TimeTicks download_start_time_; // used to collect stats. | 117 |
| 118 base::TimeTicks last_read_time_; // used to collect stats. | 118 // The following are used to collect stats. |
| 119 size_t last_buffer_size_; // used to collect stats. | 119 base::TimeTicks download_start_time_; |
| 120 int64 bytes_read_; // used to collect stats. | 120 base::TimeTicks last_read_time_; |
| 121 std::string accepts_ranges_; // used to collect stats. | 121 size_t last_buffer_size_; |
| 122 int64 bytes_read_; |
| 123 std::string accepts_ranges_; |
| 124 |
| 122 static const int kReadBufSize = 32768; // bytes | 125 static const int kReadBufSize = 32768; // bytes |
| 123 static const int kThrottleTimeMs = 200; // milliseconds | 126 static const int kThrottleTimeMs = 200; // milliseconds |
| 124 | 127 |
| 125 DISALLOW_COPY_AND_ASSIGN(DownloadResourceHandler); | 128 DISALLOW_COPY_AND_ASSIGN(DownloadResourceHandler); |
| 126 }; | 129 }; |
| 127 | 130 |
| 128 #endif // CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_RESOURCE_HANDLER_H_ | 131 #endif // CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_RESOURCE_HANDLER_H_ |
| OLD | NEW |