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_SYNC_FILE_SYSTEM_LOCAL_SYNCABLE_FILE_SYSTEM_OPERATION_H_ | 5 #ifndef CHROME_BROWSER_SYNC_FILE_SYSTEM_LOCAL_SYNCABLE_FILE_SYSTEM_OPERATION_H_ |
6 #define CHROME_BROWSER_SYNC_FILE_SYSTEM_LOCAL_SYNCABLE_FILE_SYSTEM_OPERATION_H_ | 6 #define CHROME_BROWSER_SYNC_FILE_SYSTEM_LOCAL_SYNCABLE_FILE_SYSTEM_OPERATION_H_ |
7 | 7 |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/callback.h" | 10 #include "base/callback.h" |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
84 const StatusCallback& callback) OVERRIDE; | 84 const StatusCallback& callback) OVERRIDE; |
85 virtual void CopyFileLocal(const fileapi::FileSystemURL& src_url, | 85 virtual void CopyFileLocal(const fileapi::FileSystemURL& src_url, |
86 const fileapi::FileSystemURL& dest_url, | 86 const fileapi::FileSystemURL& dest_url, |
87 CopyOrMoveOption option, | 87 CopyOrMoveOption option, |
88 const CopyFileProgressCallback& progress_callback, | 88 const CopyFileProgressCallback& progress_callback, |
89 const StatusCallback& callback) OVERRIDE; | 89 const StatusCallback& callback) OVERRIDE; |
90 virtual void MoveFileLocal(const fileapi::FileSystemURL& src_url, | 90 virtual void MoveFileLocal(const fileapi::FileSystemURL& src_url, |
91 const fileapi::FileSystemURL& dest_url, | 91 const fileapi::FileSystemURL& dest_url, |
92 CopyOrMoveOption option, | 92 CopyOrMoveOption option, |
93 const StatusCallback& callback) OVERRIDE; | 93 const StatusCallback& callback) OVERRIDE; |
94 virtual base::PlatformFileError SyncGetPlatformPath( | 94 virtual base::File::Error SyncGetPlatformPath( |
95 const fileapi::FileSystemURL& url, | 95 const fileapi::FileSystemURL& url, |
96 base::FilePath* platform_path) OVERRIDE; | 96 base::FilePath* platform_path) OVERRIDE; |
97 | 97 |
98 private: | 98 private: |
99 typedef SyncableFileSystemOperation self; | 99 typedef SyncableFileSystemOperation self; |
100 class QueueableTask; | 100 class QueueableTask; |
101 | 101 |
102 // Only SyncFileSystemBackend can create a new operation directly. | 102 // Only SyncFileSystemBackend can create a new operation directly. |
103 friend class SyncFileSystemBackend; | 103 friend class SyncFileSystemBackend; |
104 | 104 |
105 SyncableFileSystemOperation( | 105 SyncableFileSystemOperation( |
106 const fileapi::FileSystemURL& url, | 106 const fileapi::FileSystemURL& url, |
107 fileapi::FileSystemContext* file_system_context, | 107 fileapi::FileSystemContext* file_system_context, |
108 scoped_ptr<fileapi::FileSystemOperationContext> operation_context); | 108 scoped_ptr<fileapi::FileSystemOperationContext> operation_context); |
109 | 109 |
110 void DidFinish(base::PlatformFileError status); | 110 void DidFinish(base::File::Error status); |
111 void DidWrite(const WriteCallback& callback, | 111 void DidWrite(const WriteCallback& callback, |
112 base::PlatformFileError result, | 112 base::File::Error result, |
113 int64 bytes, | 113 int64 bytes, |
114 bool complete); | 114 bool complete); |
115 | 115 |
116 void OnCancelled(); | 116 void OnCancelled(); |
117 | 117 |
118 const fileapi::FileSystemURL url_; | 118 const fileapi::FileSystemURL url_; |
119 | 119 |
120 scoped_ptr<fileapi::FileSystemOperation> impl_; | 120 scoped_ptr<fileapi::FileSystemOperation> impl_; |
121 base::WeakPtr<SyncableFileOperationRunner> operation_runner_; | 121 base::WeakPtr<SyncableFileOperationRunner> operation_runner_; |
122 std::vector<fileapi::FileSystemURL> target_paths_; | 122 std::vector<fileapi::FileSystemURL> target_paths_; |
123 | 123 |
124 StatusCallback completion_callback_; | 124 StatusCallback completion_callback_; |
125 | 125 |
126 bool is_directory_operation_enabled_; | 126 bool is_directory_operation_enabled_; |
127 | 127 |
128 base::WeakPtrFactory<SyncableFileSystemOperation> weak_factory_; | 128 base::WeakPtrFactory<SyncableFileSystemOperation> weak_factory_; |
129 | 129 |
130 DISALLOW_COPY_AND_ASSIGN(SyncableFileSystemOperation); | 130 DISALLOW_COPY_AND_ASSIGN(SyncableFileSystemOperation); |
131 }; | 131 }; |
132 | 132 |
133 } // namespace sync_file_system | 133 } // namespace sync_file_system |
134 | 134 |
135 #endif // CHROME_BROWSER_SYNC_FILE_SYSTEM_LOCAL_SYNCABLE_FILE_SYSTEM_OPERATION_
H_ | 135 #endif // CHROME_BROWSER_SYNC_FILE_SYSTEM_LOCAL_SYNCABLE_FILE_SYSTEM_OPERATION_
H_ |
OLD | NEW |