| 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 |
| 11 #include "base/callback.h" | 11 #include "base/callback.h" |
| 12 #include "base/memory/scoped_ptr.h" | 12 #include "base/memory/scoped_ptr.h" |
| 13 #include "base/timer.h" | 13 #include "base/timer.h" |
| 14 #include "content/browser/download/download_types.h" | 14 #include "content/browser/download/download_types.h" |
| 15 #include "content/browser/renderer_host/resource_handler.h" | 15 #include "content/browser/renderer_host/resource_handler.h" |
| 16 #include "content/public/browser/download_id.h" | 16 #include "content/public/browser/download_id.h" |
| 17 #include "content/public/browser/global_request_id.h" | 17 #include "content/public/browser/global_request_id.h" |
| 18 #include "net/base/net_errors.h" | 18 #include "net/base/net_errors.h" |
| 19 #include "net/base/net_log.h" |
| 19 | 20 |
| 20 class DownloadFileManager; | 21 class DownloadFileManager; |
| 21 class DownloadRequestHandle; | 22 class DownloadRequestHandle; |
| 22 class ResourceDispatcherHost; | 23 class ResourceDispatcherHost; |
| 23 struct DownloadCreateInfo; | 24 struct DownloadCreateInfo; |
| 24 | 25 |
| 25 namespace content { | 26 namespace content { |
| 26 class DownloadBuffer; | 27 class DownloadBuffer; |
| 27 } | 28 } |
| 28 | 29 |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 120 bool is_paused_; | 121 bool is_paused_; |
| 121 base::OneShotTimer<DownloadResourceHandler> pause_timer_; | 122 base::OneShotTimer<DownloadResourceHandler> pause_timer_; |
| 122 | 123 |
| 123 // The following are used to collect stats. | 124 // The following are used to collect stats. |
| 124 base::TimeTicks download_start_time_; | 125 base::TimeTicks download_start_time_; |
| 125 base::TimeTicks last_read_time_; | 126 base::TimeTicks last_read_time_; |
| 126 size_t last_buffer_size_; | 127 size_t last_buffer_size_; |
| 127 int64 bytes_read_; | 128 int64 bytes_read_; |
| 128 std::string accept_ranges_; | 129 std::string accept_ranges_; |
| 129 | 130 |
| 131 const net::BoundNetLog bound_net_log_; |
| 132 |
| 130 static const int kReadBufSize = 32768; // bytes | 133 static const int kReadBufSize = 32768; // bytes |
| 131 static const int kThrottleTimeMs = 200; // milliseconds | 134 static const int kThrottleTimeMs = 200; // milliseconds |
| 132 | 135 |
| 133 DISALLOW_COPY_AND_ASSIGN(DownloadResourceHandler); | 136 DISALLOW_COPY_AND_ASSIGN(DownloadResourceHandler); |
| 134 }; | 137 }; |
| 135 | 138 |
| 136 #endif // CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_RESOURCE_HANDLER_H_ | 139 #endif // CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_RESOURCE_HANDLER_H_ |
| OLD | NEW |