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

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 formatting. 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
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 133317a98883f7beae53bc1036fe48ebe6447f97..60cd224c35c7822d6697e54d88f16aa5cf4e5abd 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
@@ -22,12 +22,6 @@ class ProvidedFileSystemInterface;
// to Read().
class FileStreamReader : public webkit_blob::FileStreamReader {
public:
- typedef base::Callback<
- void(base::WeakPtr<ProvidedFileSystemInterface> file_system,
- const base::FilePath& file_path,
- int file_handle,
- base::File::Error result)> OpenFileCompletedCallback;
-
FileStreamReader(fileapi::FileSystemContext* context,
const fileapi::FileSystemURL& url,
int64 initial_offset,
@@ -43,6 +37,11 @@ class FileStreamReader : public webkit_blob::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 +58,6 @@ class FileStreamReader : public webkit_blob::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 +94,9 @@ class FileStreamReader : public webkit_blob::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);
};

Powered by Google App Engine
This is Rietveld 408576698