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

Unified Diff: chrome/browser/chromeos/file_system_provider/fileapi/file_stream_reader.h

Issue 496953003: [fsp] Make the reading operation abortable. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixed. Created 6 years, 4 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/file_system_provider/fileapi/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/file_system_provider/fileapi/file_stream_reader.h
diff --git a/chrome/browser/chromeos/file_system_provider/fileapi/file_stream_reader.h b/chrome/browser/chromeos/file_system_provider/fileapi/file_stream_reader.h
index 8b4375a9ce8602c86701badd48f20ba80ab78d42..909bb8a846da5d8e767d5bf3eeb163c7e2536258 100644
--- a/chrome/browser/chromeos/file_system_provider/fileapi/file_stream_reader.h
+++ b/chrome/browser/chromeos/file_system_provider/fileapi/file_stream_reader.h
@@ -43,6 +43,11 @@ class FileStreamReader : public storage::FileStreamReader {
const net::Int64CompletionCallback& callback) OVERRIDE;
private:
+ // Helper class for executing operations on the provided file system. All
+ // of its methods must be called on UI thread. Callbacks are called on IO
+ // thread.
+ class OperationRunner;
+
// State of the file stream reader.
enum State { NOT_INITIALIZED, INITIALIZING, INITIALIZED, FAILED };
@@ -59,9 +64,6 @@ class FileStreamReader : public storage::FileStreamReader {
void OnOpenFileCompleted(
const base::Closure& pending_closure,
const net::Int64CompletionCallback& error_callback,
- base::WeakPtr<ProvidedFileSystemInterface> file_system,
- const base::FilePath& file_path,
- int file_handle,
base::File::Error result);
// Called when initialization is completed with either a success or an error.
@@ -98,13 +100,9 @@ class FileStreamReader : public storage::FileStreamReader {
int64 current_offset_;
int64 current_length_;
base::Time expected_modification_time_;
+ scoped_refptr<OperationRunner> runner_;
State state_;
- // Set during initialization (in case of a success).
- base::WeakPtr<ProvidedFileSystemInterface> file_system_;
- base::FilePath file_path_;
- int file_handle_;
-
base::WeakPtrFactory<FileStreamReader> weak_ptr_factory_;
DISALLOW_COPY_AND_ASSIGN(FileStreamReader);
};
« no previous file with comments | « no previous file | chrome/browser/chromeos/file_system_provider/fileapi/file_stream_reader.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698