Chromium Code Reviews| Index: content/browser/download/download_resource_handler.h |
| diff --git a/content/browser/download/download_resource_handler.h b/content/browser/download/download_resource_handler.h |
| index 016756c58ad68c336a0055f310e8f0db903b5f23..935a0efa02c8b0608906fb85b619b81216848347 100644 |
| --- a/content/browser/download/download_resource_handler.h |
| +++ b/content/browser/download/download_resource_handler.h |
| @@ -11,10 +11,11 @@ |
| #include "base/callback.h" |
| #include "base/memory/scoped_ptr.h" |
| #include "base/timer.h" |
| -#include "content/browser/download/download_file.h" |
| #include "content/browser/download/download_id.h" |
| +#include "content/browser/download/download_types.h" |
| #include "content/browser/renderer_host/global_request_id.h" |
| #include "content/browser/renderer_host/resource_handler.h" |
| +#include "net/base/net_errors.h" |
| class DownloadFileManager; |
| class ResourceDispatcherHost; |
| @@ -79,6 +80,9 @@ class DownloadResourceHandler : public ResourceHandler { |
| void set_content_disposition(const std::string& content_disposition); |
| + // Location within the resource at which to start the download. |
| + void set_start_offset(int64 bytes) { start_offset_ = bytes; } |
|
Randy Smith (Not in Mondays)
2011/11/16 21:40:25
It occurs to me to ask: Should this be in the cons
Randy Smith (Not in Mondays)
2011/11/16 21:40:25
Note that there's an awesome unit-test opportunity
ahendrickson
2011/11/19 20:18:04
We have a download ID at construction time (in Buf
ahendrickson
2011/11/19 20:18:04
Done. The unit test fails currently, but will suc
Randy Smith (Not in Mondays)
2011/11/21 02:10:17
We never have access to the DownloadItem on the IO
ahendrickson
2011/11/21 20:34:46
The unit test now succeeds.
ahendrickson
2011/11/21 20:34:46
Changed it to be in the constructor, so this sette
|
| + |
| void CheckWriteProgress(); |
| std::string DebugString() const; |
| @@ -107,6 +111,7 @@ class DownloadResourceHandler : public ResourceHandler { |
| base::TimeTicks download_start_time_; // used to collect stats. |
| base::TimeTicks last_read_time_; // used to collect stats. |
| size_t last_buffer_size_; // used to collect stats. |
| + int64 start_offset_; |
| static const int kReadBufSize = 32768; // bytes |
| static const int kThrottleTimeMs = 200; // milliseconds |