Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CHROME_BROWSER_CHROMEOS_FILEAPI_REMOTE_FILE_SYSTEM_OPERATION_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_FILEAPI_REMOTE_FILE_SYSTEM_OPERATION_H_ |
| 6 #define CHROME_BROWSER_CHROMEOS_FILEAPI_REMOTE_FILE_SYSTEM_OPERATION_H_ | 6 #define CHROME_BROWSER_CHROMEOS_FILEAPI_REMOTE_FILE_SYSTEM_OPERATION_H_ |
| 7 | 7 |
| 8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
| 9 #include "base/memory/weak_ptr.h" | 9 #include "base/memory/weak_ptr.h" |
| 10 #include "webkit/browser/fileapi/file_system_operation.h" | 10 #include "webkit/browser/fileapi/file_system_operation.h" |
| (...skipping 10 matching lines...) Expand all Loading... | |
| 21 } | 21 } |
| 22 | 22 |
| 23 namespace chromeos { | 23 namespace chromeos { |
| 24 | 24 |
| 25 // FileSystemOperation implementation for local file systems. | 25 // FileSystemOperation implementation for local file systems. |
| 26 class RemoteFileSystemOperation | 26 class RemoteFileSystemOperation |
| 27 : public fileapi::FileSystemOperation, | 27 : public fileapi::FileSystemOperation, |
| 28 public base::SupportsWeakPtr<RemoteFileSystemOperation> { | 28 public base::SupportsWeakPtr<RemoteFileSystemOperation> { |
| 29 public: | 29 public: |
| 30 typedef fileapi::FileWriterDelegate FileWriterDelegate; | 30 typedef fileapi::FileWriterDelegate FileWriterDelegate; |
| 31 | |
| 32 RemoteFileSystemOperation( | |
|
kinaba
2013/07/04 05:47:43
nit: explicit?
hidehiko
2013/07/04 05:51:32
Done.
| |
| 33 scoped_refptr<fileapi::RemoteFileSystemProxyInterface> remote_proxy); | |
| 34 | |
| 31 virtual ~RemoteFileSystemOperation(); | 35 virtual ~RemoteFileSystemOperation(); |
| 32 | 36 |
| 33 // FileSystemOperation overrides. | 37 // FileSystemOperation overrides. |
| 34 virtual void CreateFile(const fileapi::FileSystemURL& url, | 38 virtual void CreateFile(const fileapi::FileSystemURL& url, |
| 35 bool exclusive, | 39 bool exclusive, |
| 36 const StatusCallback& callback) OVERRIDE; | 40 const StatusCallback& callback) OVERRIDE; |
| 37 virtual void CreateDirectory(const fileapi::FileSystemURL& url, | 41 virtual void CreateDirectory(const fileapi::FileSystemURL& url, |
| 38 bool exclusive, | 42 bool exclusive, |
| 39 bool recursive, | 43 bool recursive, |
| 40 const StatusCallback& callback) OVERRIDE; | 44 const StatusCallback& callback) OVERRIDE; |
| (...skipping 29 matching lines...) Expand all Loading... | |
| 70 int file_flags, | 74 int file_flags, |
| 71 base::ProcessHandle peer_handle, | 75 base::ProcessHandle peer_handle, |
| 72 const OpenFileCallback& callback) OVERRIDE; | 76 const OpenFileCallback& callback) OVERRIDE; |
| 73 virtual fileapi::LocalFileSystemOperation* | 77 virtual fileapi::LocalFileSystemOperation* |
| 74 AsLocalFileSystemOperation() OVERRIDE; | 78 AsLocalFileSystemOperation() OVERRIDE; |
| 75 virtual void CreateSnapshotFile( | 79 virtual void CreateSnapshotFile( |
| 76 const fileapi::FileSystemURL& url, | 80 const fileapi::FileSystemURL& url, |
| 77 const SnapshotFileCallback& callback) OVERRIDE; | 81 const SnapshotFileCallback& callback) OVERRIDE; |
| 78 | 82 |
| 79 private: | 83 private: |
| 80 friend class CrosMountPointProvider; | |
| 81 | |
| 82 RemoteFileSystemOperation( | |
| 83 scoped_refptr<fileapi::RemoteFileSystemProxyInterface> remote_proxy); | |
| 84 | |
| 85 // Used only for internal assertions. | 84 // Used only for internal assertions. |
| 86 // Returns false if there's another inflight pending operation. | 85 // Returns false if there's another inflight pending operation. |
| 87 bool SetPendingOperationType(OperationType type); | 86 bool SetPendingOperationType(OperationType type); |
| 88 | 87 |
| 89 // Generic callback that translates platform errors to WebKit error codes. | 88 // Generic callback that translates platform errors to WebKit error codes. |
| 90 void DidDirectoryExists(const StatusCallback& callback, | 89 void DidDirectoryExists(const StatusCallback& callback, |
| 91 base::PlatformFileError rv, | 90 base::PlatformFileError rv, |
| 92 const base::PlatformFileInfo& file_info); | 91 const base::PlatformFileInfo& file_info); |
| 93 void DidFileExists(const StatusCallback& callback, | 92 void DidFileExists(const StatusCallback& callback, |
| 94 base::PlatformFileError rv, | 93 base::PlatformFileError rv, |
| (...skipping 17 matching lines...) Expand all Loading... | |
| 112 scoped_ptr<fileapi::FileWriterDelegate> file_writer_delegate_; | 111 scoped_ptr<fileapi::FileWriterDelegate> file_writer_delegate_; |
| 113 | 112 |
| 114 StatusCallback cancel_callback_; | 113 StatusCallback cancel_callback_; |
| 115 | 114 |
| 116 DISALLOW_COPY_AND_ASSIGN(RemoteFileSystemOperation); | 115 DISALLOW_COPY_AND_ASSIGN(RemoteFileSystemOperation); |
| 117 }; | 116 }; |
| 118 | 117 |
| 119 } // namespace chromeos | 118 } // namespace chromeos |
| 120 | 119 |
| 121 #endif // CHROME_BROWSER_CHROMEOS_FILEAPI_REMOTE_FILE_SYSTEM_OPERATION_H_ | 120 #endif // CHROME_BROWSER_CHROMEOS_FILEAPI_REMOTE_FILE_SYSTEM_OPERATION_H_ |
| OLD | NEW |