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

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

Issue 211483004: Remove some PlatformFile instances from ChromeOS Drive. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Change FileStream destruction logic Created 6 years, 9 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/file_system/truncate_operation.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.cc
diff --git a/chrome/browser/chromeos/drive/drive_file_stream_reader.cc b/chrome/browser/chromeos/drive/drive_file_stream_reader.cc
index e9d97b115936e6803b274d78bb759b6c4b637f31..be4bd084a35f3c155df2ea0e0c1462464f48fba4 100644
--- a/chrome/browser/chromeos/drive/drive_file_stream_reader.cc
+++ b/chrome/browser/chromeos/drive/drive_file_stream_reader.cc
@@ -119,6 +119,9 @@ int LocalReaderProxy::Read(net::IOBuffer* buffer, int buffer_length,
buffer_length = static_cast<int>(remaining_length_);
}
+ if (!buffer_length)
+ return 0;
+
file_reader_->Read(buffer, buffer_length,
base::Bind(&LocalReaderProxy::OnReadCompleted,
weak_ptr_factory_.GetWeakPtr(), callback));
« no previous file with comments | « no previous file | chrome/browser/chromeos/drive/file_system/truncate_operation.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698