OLD | NEW |
---|---|
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 WEBKIT_FILEAPI_FILE_SYSTEM_OPERATION_H_ | 5 #ifndef WEBKIT_FILEAPI_FILE_SYSTEM_OPERATION_H_ |
6 #define WEBKIT_FILEAPI_FILE_SYSTEM_OPERATION_H_ | 6 #define WEBKIT_FILEAPI_FILE_SYSTEM_OPERATION_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
11 #include "base/file_path.h" | 11 #include "base/file_path.h" |
12 #include "base/file_util_proxy.h" | 12 #include "base/file_util_proxy.h" |
13 #include "base/gtest_prod_util.h" | 13 #include "base/gtest_prod_util.h" |
14 #include "base/memory/ref_counted.h" | 14 #include "base/memory/ref_counted.h" |
15 #include "base/memory/scoped_ptr.h" | 15 #include "base/memory/scoped_ptr.h" |
16 #include "base/message_loop_proxy.h" | |
17 #include "base/platform_file.h" | 16 #include "base/platform_file.h" |
18 #include "base/process.h" | 17 #include "base/process.h" |
19 #include "googleurl/src/gurl.h" | 18 #include "googleurl/src/gurl.h" |
20 #include "webkit/fileapi/file_system_operation_context.h" | 19 #include "webkit/fileapi/file_system_operation_context.h" |
21 #include "webkit/fileapi/file_system_operation_interface.h" | 20 #include "webkit/fileapi/file_system_operation_interface.h" |
22 #include "webkit/fileapi/file_system_types.h" | 21 #include "webkit/fileapi/file_system_types.h" |
23 #include "webkit/quota/quota_manager.h" | 22 #include "webkit/quota/quota_manager.h" |
24 | 23 |
25 namespace base { | 24 namespace base { |
26 class Time; | 25 class Time; |
26 class SequencedTaskRunner; | |
27 } | 27 } |
28 | 28 |
29 namespace chromeos { | 29 namespace chromeos { |
30 class CrosMountPointProvider; | 30 class CrosMountPointProvider; |
31 } | 31 } |
32 | 32 |
33 namespace net { | 33 namespace net { |
34 class URLRequest; | 34 class URLRequest; |
35 class URLRequestContext; | 35 class URLRequestContext; |
36 } // namespace net | 36 } // namespace net |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
123 friend class IsolatedMountPointProvider; | 123 friend class IsolatedMountPointProvider; |
124 friend class SandboxMountPointProvider; | 124 friend class SandboxMountPointProvider; |
125 friend class chromeos::CrosMountPointProvider; | 125 friend class chromeos::CrosMountPointProvider; |
126 | 126 |
127 friend class FileSystemOperationTest; | 127 friend class FileSystemOperationTest; |
128 friend class FileSystemOperationWriteTest; | 128 friend class FileSystemOperationWriteTest; |
129 friend class FileWriterDelegateTest; | 129 friend class FileWriterDelegateTest; |
130 friend class FileSystemTestOriginHelper; | 130 friend class FileSystemTestOriginHelper; |
131 friend class FileSystemQuotaTest; | 131 friend class FileSystemQuotaTest; |
132 | 132 |
133 FileSystemOperation(scoped_refptr<base::MessageLoopProxy> proxy, | 133 FileSystemOperation(base::SequencedTaskRunner* task_runner, |
michaeln
2012/04/27 22:31:08
similarly, maybe the 'runner' could be picked up f
kinuko
2012/05/04 19:05:35
Done.
| |
134 FileSystemContext* file_system_context); | 134 FileSystemContext* file_system_context); |
135 | 135 |
136 FileSystemContext* file_system_context() const { | 136 FileSystemContext* file_system_context() const { |
137 return operation_context_.file_system_context(); | 137 return operation_context_.file_system_context(); |
138 } | 138 } |
139 | 139 |
140 FileSystemOperationContext* file_system_operation_context() { | 140 FileSystemOperationContext* file_system_operation_context() { |
141 return &operation_context_; | 141 return &operation_context_; |
142 } | 142 } |
143 | 143 |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
229 base::PlatformFileError SetUpFileSystemPath( | 229 base::PlatformFileError SetUpFileSystemPath( |
230 const GURL& path_url, | 230 const GURL& path_url, |
231 FileSystemPath* file_system_path, | 231 FileSystemPath* file_system_path, |
232 FileSystemFileUtil** file_util, | 232 FileSystemFileUtil** file_util, |
233 SetUpPathMode mode); | 233 SetUpPathMode mode); |
234 | 234 |
235 // Used only for internal assertions. | 235 // Used only for internal assertions. |
236 // Returns false if there's another inflight pending operation. | 236 // Returns false if there's another inflight pending operation. |
237 bool SetPendingOperationType(OperationType type); | 237 bool SetPendingOperationType(OperationType type); |
238 | 238 |
239 // Proxy for calling file_util_proxy methods. | 239 // Task runner for making file operations. |
240 scoped_refptr<base::MessageLoopProxy> proxy_; | 240 scoped_refptr<base::SequencedTaskRunner> task_runner_; |
241 | 241 |
242 FileSystemOperationContext operation_context_; | 242 FileSystemOperationContext operation_context_; |
243 FileSystemPath src_path_; | 243 FileSystemPath src_path_; |
244 FileSystemPath dest_path_; | 244 FileSystemPath dest_path_; |
245 FileSystemFileUtil* src_util_; // Not owned. | 245 FileSystemFileUtil* src_util_; // Not owned. |
246 FileSystemFileUtil* dest_util_; // Not owned. | 246 FileSystemFileUtil* dest_util_; // Not owned. |
247 | 247 |
248 // This is set before any write operations. The destructor of | 248 // This is set before any write operations. The destructor of |
249 // ScopedQuotaNotifier sends notification to the QuotaManager | 249 // ScopedQuotaNotifier sends notification to the QuotaManager |
250 // to tell the update is done; so that we can make sure notify | 250 // to tell the update is done; so that we can make sure notify |
(...skipping 21 matching lines...) Expand all Loading... | |
272 | 272 |
273 // A flag to make sure we call operation only once per instance. | 273 // A flag to make sure we call operation only once per instance. |
274 OperationType pending_operation_; | 274 OperationType pending_operation_; |
275 | 275 |
276 DISALLOW_COPY_AND_ASSIGN(FileSystemOperation); | 276 DISALLOW_COPY_AND_ASSIGN(FileSystemOperation); |
277 }; | 277 }; |
278 | 278 |
279 } // namespace fileapi | 279 } // namespace fileapi |
280 | 280 |
281 #endif // WEBKIT_FILEAPI_FILE_SYSTEM_OPERATION_H_ | 281 #endif // WEBKIT_FILEAPI_FILE_SYSTEM_OPERATION_H_ |
OLD | NEW |