| 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 <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <memory> |
| 10 #include <vector> | 11 #include <vector> |
| 11 | 12 |
| 12 #include "base/callback.h" | 13 #include "base/callback.h" |
| 13 #include "base/macros.h" | 14 #include "base/macros.h" |
| 14 #include "base/memory/ref_counted.h" | 15 #include "base/memory/ref_counted.h" |
| 15 #include "base/memory/scoped_ptr.h" | |
| 16 #include "base/memory/weak_ptr.h" | 16 #include "base/memory/weak_ptr.h" |
| 17 #include "base/threading/non_thread_safe.h" | 17 #include "base/threading/non_thread_safe.h" |
| 18 #include "storage/browser/fileapi/file_system_operation.h" | 18 #include "storage/browser/fileapi/file_system_operation.h" |
| 19 #include "storage/browser/fileapi/file_system_url.h" | 19 #include "storage/browser/fileapi/file_system_url.h" |
| 20 | 20 |
| 21 namespace storage { | 21 namespace storage { |
| 22 class FileSystemContext; | 22 class FileSystemContext; |
| 23 class FileSystemOperationContext; | 23 class FileSystemOperationContext; |
| 24 } | 24 } |
| 25 | 25 |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 58 const StatusCallback& callback) override; | 58 const StatusCallback& callback) override; |
| 59 void GetMetadata(const storage::FileSystemURL& url, | 59 void GetMetadata(const storage::FileSystemURL& url, |
| 60 int fields, | 60 int fields, |
| 61 const GetMetadataCallback& callback) override; | 61 const GetMetadataCallback& callback) override; |
| 62 void ReadDirectory(const storage::FileSystemURL& url, | 62 void ReadDirectory(const storage::FileSystemURL& url, |
| 63 const ReadDirectoryCallback& callback) override; | 63 const ReadDirectoryCallback& callback) override; |
| 64 void Remove(const storage::FileSystemURL& url, | 64 void Remove(const storage::FileSystemURL& url, |
| 65 bool recursive, | 65 bool recursive, |
| 66 const StatusCallback& callback) override; | 66 const StatusCallback& callback) override; |
| 67 void Write(const storage::FileSystemURL& url, | 67 void Write(const storage::FileSystemURL& url, |
| 68 scoped_ptr<storage::FileWriterDelegate> writer_delegate, | 68 std::unique_ptr<storage::FileWriterDelegate> writer_delegate, |
| 69 scoped_ptr<net::URLRequest> blob_request, | 69 std::unique_ptr<net::URLRequest> blob_request, |
| 70 const WriteCallback& callback) override; | 70 const WriteCallback& callback) override; |
| 71 void Truncate(const storage::FileSystemURL& url, | 71 void Truncate(const storage::FileSystemURL& url, |
| 72 int64_t length, | 72 int64_t length, |
| 73 const StatusCallback& callback) override; | 73 const StatusCallback& callback) override; |
| 74 void TouchFile(const storage::FileSystemURL& url, | 74 void TouchFile(const storage::FileSystemURL& url, |
| 75 const base::Time& last_access_time, | 75 const base::Time& last_access_time, |
| 76 const base::Time& last_modified_time, | 76 const base::Time& last_modified_time, |
| 77 const StatusCallback& callback) override; | 77 const StatusCallback& callback) override; |
| 78 void OpenFile(const storage::FileSystemURL& url, | 78 void OpenFile(const storage::FileSystemURL& url, |
| 79 int file_flags, | 79 int file_flags, |
| (...skipping 23 matching lines...) Expand all Loading... |
| 103 private: | 103 private: |
| 104 typedef SyncableFileSystemOperation self; | 104 typedef SyncableFileSystemOperation self; |
| 105 class QueueableTask; | 105 class QueueableTask; |
| 106 | 106 |
| 107 // Only SyncFileSystemBackend can create a new operation directly. | 107 // Only SyncFileSystemBackend can create a new operation directly. |
| 108 friend class SyncFileSystemBackend; | 108 friend class SyncFileSystemBackend; |
| 109 | 109 |
| 110 SyncableFileSystemOperation( | 110 SyncableFileSystemOperation( |
| 111 const storage::FileSystemURL& url, | 111 const storage::FileSystemURL& url, |
| 112 storage::FileSystemContext* file_system_context, | 112 storage::FileSystemContext* file_system_context, |
| 113 scoped_ptr<storage::FileSystemOperationContext> operation_context); | 113 std::unique_ptr<storage::FileSystemOperationContext> operation_context); |
| 114 | 114 |
| 115 void DidFinish(base::File::Error status); | 115 void DidFinish(base::File::Error status); |
| 116 void DidWrite(const WriteCallback& callback, | 116 void DidWrite(const WriteCallback& callback, |
| 117 base::File::Error result, | 117 base::File::Error result, |
| 118 int64_t bytes, | 118 int64_t bytes, |
| 119 bool complete); | 119 bool complete); |
| 120 | 120 |
| 121 void OnCancelled(); | 121 void OnCancelled(); |
| 122 | 122 |
| 123 const storage::FileSystemURL url_; | 123 const storage::FileSystemURL url_; |
| 124 | 124 |
| 125 scoped_ptr<storage::FileSystemOperation> impl_; | 125 std::unique_ptr<storage::FileSystemOperation> impl_; |
| 126 base::WeakPtr<SyncableFileOperationRunner> operation_runner_; | 126 base::WeakPtr<SyncableFileOperationRunner> operation_runner_; |
| 127 std::vector<storage::FileSystemURL> target_paths_; | 127 std::vector<storage::FileSystemURL> target_paths_; |
| 128 | 128 |
| 129 StatusCallback completion_callback_; | 129 StatusCallback completion_callback_; |
| 130 | 130 |
| 131 base::WeakPtrFactory<SyncableFileSystemOperation> weak_factory_; | 131 base::WeakPtrFactory<SyncableFileSystemOperation> weak_factory_; |
| 132 | 132 |
| 133 DISALLOW_COPY_AND_ASSIGN(SyncableFileSystemOperation); | 133 DISALLOW_COPY_AND_ASSIGN(SyncableFileSystemOperation); |
| 134 }; | 134 }; |
| 135 | 135 |
| 136 } // namespace sync_file_system | 136 } // namespace sync_file_system |
| 137 | 137 |
| 138 #endif // CHROME_BROWSER_SYNC_FILE_SYSTEM_LOCAL_SYNCABLE_FILE_SYSTEM_OPERATION_
H_ | 138 #endif // CHROME_BROWSER_SYNC_FILE_SYSTEM_LOCAL_SYNCABLE_FILE_SYSTEM_OPERATION_
H_ |
| OLD | NEW |