| 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 15 matching lines...) Expand all Loading... |
| 26 class DownloadBuffer; | 26 class DownloadBuffer; |
| 27 } | 27 } |
| 28 | 28 |
| 29 namespace net { | 29 namespace net { |
| 30 class URLRequest; | 30 class URLRequest; |
| 31 } // namespace net | 31 } // namespace net |
| 32 | 32 |
| 33 // Forwards data to the download thread. | 33 // Forwards data to the download thread. |
| 34 class DownloadResourceHandler : public ResourceHandler { | 34 class DownloadResourceHandler : public ResourceHandler { |
| 35 public: | 35 public: |
| 36 typedef content::DownloadManager::OnStartedCallback OnStartedCallback; | 36 typedef content::DownloadUrlParameters::OnStartedCallback OnStartedCallback; |
| 37 | 37 |
| 38 static const size_t kLoadsToWrite = 100; // number of data buffers queued | 38 static const size_t kLoadsToWrite = 100; // number of data buffers queued |
| 39 | 39 |
| 40 // started_cb will be called exactly once on the UI thread. | 40 // started_cb will be called exactly once on the UI thread. |
| 41 DownloadResourceHandler(int render_process_host_id, | 41 DownloadResourceHandler(int render_process_host_id, |
| 42 int render_view_id, | 42 int render_view_id, |
| 43 int request_id, | 43 int request_id, |
| 44 const GURL& url, | 44 const GURL& url, |
| 45 DownloadFileManager* download_file_manager, | 45 DownloadFileManager* download_file_manager, |
| 46 net::URLRequest* request, | 46 net::URLRequest* request, |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 129 int64 bytes_read_; | 129 int64 bytes_read_; |
| 130 std::string accept_ranges_; | 130 std::string accept_ranges_; |
| 131 | 131 |
| 132 static const int kReadBufSize = 32768; // bytes | 132 static const int kReadBufSize = 32768; // bytes |
| 133 static const int kThrottleTimeMs = 200; // milliseconds | 133 static const int kThrottleTimeMs = 200; // milliseconds |
| 134 | 134 |
| 135 DISALLOW_COPY_AND_ASSIGN(DownloadResourceHandler); | 135 DISALLOW_COPY_AND_ASSIGN(DownloadResourceHandler); |
| 136 }; | 136 }; |
| 137 | 137 |
| 138 #endif // CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_RESOURCE_HANDLER_H_ | 138 #endif // CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_RESOURCE_HANDLER_H_ |
| OLD | NEW |