| 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_RENDERER_HOST_DOWNLOAD_RESOURCE_HANDLER_H_ | 5 #ifndef CHROME_BROWSER_RENDERER_HOST_DOWNLOAD_RESOURCE_HANDLER_H_ |
| 6 #define CHROME_BROWSER_RENDERER_HOST_DOWNLOAD_RESOURCE_HANDLER_H_ | 6 #define CHROME_BROWSER_RENDERER_HOST_DOWNLOAD_RESOURCE_HANDLER_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 96 | 96 |
| 97 // A helper function that updates UMA for download url checks. | 97 // A helper function that updates UMA for download url checks. |
| 98 static void UpdateDownloadUrlCheckStats(SBStatsType stat_type); | 98 static void UpdateDownloadUrlCheckStats(SBStatsType stat_type); |
| 99 | 99 |
| 100 int download_id_; | 100 int download_id_; |
| 101 GlobalRequestID global_id_; | 101 GlobalRequestID global_id_; |
| 102 int render_view_id_; | 102 int render_view_id_; |
| 103 scoped_refptr<net::IOBuffer> read_buffer_; | 103 scoped_refptr<net::IOBuffer> read_buffer_; |
| 104 std::string content_disposition_; | 104 std::string content_disposition_; |
| 105 GURL url_; | 105 GURL url_; |
| 106 GURL original_url_; // original URL before any redirection. |
| 106 int64 content_length_; | 107 int64 content_length_; |
| 107 DownloadFileManager* download_file_manager_; | 108 DownloadFileManager* download_file_manager_; |
| 108 net::URLRequest* request_; | 109 net::URLRequest* request_; |
| 109 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. |
| 110 DownloadSaveInfo save_info_; | 111 DownloadSaveInfo save_info_; |
| 111 DownloadBuffer* buffer_; | 112 DownloadBuffer* buffer_; |
| 112 ResourceDispatcherHost* rdh_; | 113 ResourceDispatcherHost* rdh_; |
| 113 bool is_paused_; | 114 bool is_paused_; |
| 114 base::OneShotTimer<DownloadResourceHandler> pause_timer_; | 115 base::OneShotTimer<DownloadResourceHandler> pause_timer_; |
| 115 bool url_check_pending_; | 116 bool url_check_pending_; |
| 116 base::TimeTicks download_start_time_; // used to collect stats. | 117 base::TimeTicks download_start_time_; // used to collect stats. |
| 117 | 118 |
| 118 static const int kReadBufSize = 32768; // bytes | 119 static const int kReadBufSize = 32768; // bytes |
| 119 static const size_t kLoadsToWrite = 100; // number of data buffers queued | 120 static const size_t kLoadsToWrite = 100; // number of data buffers queued |
| 120 static const int kThrottleTimeMs = 200; // milliseconds | 121 static const int kThrottleTimeMs = 200; // milliseconds |
| 121 | 122 |
| 122 DISALLOW_COPY_AND_ASSIGN(DownloadResourceHandler); | 123 DISALLOW_COPY_AND_ASSIGN(DownloadResourceHandler); |
| 123 }; | 124 }; |
| 124 | 125 |
| 125 #endif // CHROME_BROWSER_RENDERER_HOST_DOWNLOAD_RESOURCE_HANDLER_H_ | 126 #endif // CHROME_BROWSER_RENDERER_HOST_DOWNLOAD_RESOURCE_HANDLER_H_ |
| OLD | NEW |