Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4602)

Unified Diff: chrome/browser/chromeos/drive/drive_file_stream_reader.h

Issue 291483005: drive: Discard stream reader canceller as soon as the required data is obtained. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/browser/chromeos/drive/drive_file_stream_reader.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chromeos/drive/drive_file_stream_reader.h
diff --git a/chrome/browser/chromeos/drive/drive_file_stream_reader.h b/chrome/browser/chromeos/drive/drive_file_stream_reader.h
index b6a2b1d3bf9841cb9fa6ef68002578e4ffa63b2f..28eac15d9860edd0764dd68db74d70be3e8e2fd0 100644
--- a/chrome/browser/chromeos/drive/drive_file_stream_reader.h
+++ b/chrome/browser/chromeos/drive/drive_file_stream_reader.h
@@ -88,9 +88,11 @@ class NetworkReaderProxy : public ReaderProxy {
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.
@@ -110,6 +112,10 @@ class NetworkReaderProxy : public ReaderProxy {
// 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.
« no previous file with comments | « no previous file | chrome/browser/chromeos/drive/drive_file_stream_reader.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698