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 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
94 std::string DebugString() const; | 94 std::string DebugString() const; |
95 | 95 |
96 private: | 96 private: |
97 virtual ~DownloadResourceHandler(); | 97 virtual ~DownloadResourceHandler(); |
98 | 98 |
99 void StartPauseTimer(); | 99 void StartPauseTimer(); |
100 void CallStartedCB(content::DownloadId id, net::Error error); | 100 void CallStartedCB(content::DownloadId id, net::Error error); |
101 | 101 |
102 // Generates a DownloadId and calls DownloadFileManager. | 102 // Generates a DownloadId and calls DownloadFileManager. |
103 void StartOnUIThread(scoped_ptr<DownloadCreateInfo> info, | 103 void StartOnUIThread(scoped_ptr<DownloadCreateInfo> info, |
104 DownloadRequestHandle handle); | 104 const DownloadRequestHandle& handle); |
105 void set_download_id(content::DownloadId id); | 105 void set_download_id(content::DownloadId id); |
106 | 106 |
107 content::DownloadId download_id_; | 107 content::DownloadId download_id_; |
108 content::GlobalRequestID global_id_; | 108 content::GlobalRequestID global_id_; |
109 int render_view_id_; | 109 int render_view_id_; |
110 scoped_refptr<net::IOBuffer> read_buffer_; | 110 scoped_refptr<net::IOBuffer> read_buffer_; |
111 std::string content_disposition_; | 111 std::string content_disposition_; |
112 int64 content_length_; | 112 int64 content_length_; |
113 DownloadFileManager* download_file_manager_; | 113 DownloadFileManager* download_file_manager_; |
114 net::URLRequest* request_; | 114 net::URLRequest* request_; |
(...skipping 12 matching lines...) Expand all Loading... |
127 int64 bytes_read_; | 127 int64 bytes_read_; |
128 std::string accept_ranges_; | 128 std::string accept_ranges_; |
129 | 129 |
130 static const int kReadBufSize = 32768; // bytes | 130 static const int kReadBufSize = 32768; // bytes |
131 static const int kThrottleTimeMs = 200; // milliseconds | 131 static const int kThrottleTimeMs = 200; // milliseconds |
132 | 132 |
133 DISALLOW_COPY_AND_ASSIGN(DownloadResourceHandler); | 133 DISALLOW_COPY_AND_ASSIGN(DownloadResourceHandler); |
134 }; | 134 }; |
135 | 135 |
136 #endif // CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_RESOURCE_HANDLER_H_ | 136 #endif // CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_RESOURCE_HANDLER_H_ |
OLD | NEW |