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