// ReaderProxy overrides.
virtual int Read(net::IOBuffer* buffer, int buffer_length,
- const net::CompletionCallback& callback) OVERRIDE;
- virtual void OnGetContent(scoped_ptr<std::string> data) OVERRIDE;
- virtual void OnCompleted(FileError error) OVERRIDE;
+ const net::CompletionCallback& callback) override;
+ virtual void OnGetContent(scoped_ptr<std::string> data) override;
+ virtual void OnCompleted(FileError error) override;
private:
scoped_ptr<util::LocalFileReader> file_reader_;
public:
// If the instance is deleted during the download process, it is necessary
// to cancel the job. |job_canceller| should be the callback to run the
- // cancelling.
+ // cancelling. |full_content_length| is necessary for determining whether the
+ // deletion is done in the middle of download process.
NetworkReaderProxy(
- int64 offset, int64 content_length, const base::Closure& job_canceller);
+ int64 offset, int64 content_length, int64 full_content_length,
+ const base::Closure& job_canceller);
virtual ~NetworkReaderProxy();
// ReaderProxy overrides.
virtual int Read(net::IOBuffer* buffer, int buffer_length,
- const net::CompletionCallback& callback) OVERRIDE;
- virtual void OnGetContent(scoped_ptr<std::string> data) OVERRIDE;
- virtual void OnCompleted(FileError error) OVERRIDE;
+ const net::CompletionCallback& callback) override;
+ virtual void OnGetContent(scoped_ptr<std::string> data) override;
+ virtual void OnCompleted(FileError error) override;
private:
// The data received from the server, but not yet read.
// received from the server).
int64 remaining_content_length_;
+ // Flag to remember whether this read request is for reading till the end of
+ // the file.
+ const bool is_full_download_;
+
int error_code_;
// To support pending Read(), it is necessary to keep its arguments.