OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_LOCAL_DISCOVERY_STORAGE_PRIVET_FILESYSTEM_ASYNC_UTIL_H_ | 5 #ifndef CHROME_BROWSER_LOCAL_DISCOVERY_STORAGE_PRIVET_FILESYSTEM_ASYNC_UTIL_H_ |
6 #define CHROME_BROWSER_LOCAL_DISCOVERY_STORAGE_PRIVET_FILESYSTEM_ASYNC_UTIL_H_ | 6 #define CHROME_BROWSER_LOCAL_DISCOVERY_STORAGE_PRIVET_FILESYSTEM_ASYNC_UTIL_H_ |
7 | 7 |
| 8 #include <set> |
| 9 |
| 10 #include "chrome/browser/local_discovery/storage/privet_filesystem_operations.h" |
| 11 #include "content/public/browser/browser_context.h" |
8 #include "webkit/browser/fileapi/async_file_util.h" | 12 #include "webkit/browser/fileapi/async_file_util.h" |
9 | 13 |
10 namespace local_discovery { | 14 namespace local_discovery { |
11 | 15 |
12 class PrivetFileSystemAsyncUtil : public fileapi::AsyncFileUtil { | 16 class PrivetFileSystemAsyncUtil |
| 17 : public fileapi::AsyncFileUtil, |
| 18 public PrivetFileSystemAsyncOperationContainer { |
13 public: | 19 public: |
| 20 explicit PrivetFileSystemAsyncUtil(content::BrowserContext* browser_context); |
| 21 virtual ~PrivetFileSystemAsyncUtil(); |
| 22 |
14 virtual void CreateOrOpen( | 23 virtual void CreateOrOpen( |
15 scoped_ptr<fileapi::FileSystemOperationContext> context, | 24 scoped_ptr<fileapi::FileSystemOperationContext> context, |
16 const fileapi::FileSystemURL& url, | 25 const fileapi::FileSystemURL& url, |
17 int file_flags, | 26 int file_flags, |
18 const CreateOrOpenCallback& callback) OVERRIDE; | 27 const CreateOrOpenCallback& callback) OVERRIDE; |
19 virtual void EnsureFileExists( | 28 virtual void EnsureFileExists( |
20 scoped_ptr<fileapi::FileSystemOperationContext> context, | 29 scoped_ptr<fileapi::FileSystemOperationContext> context, |
21 const fileapi::FileSystemURL& url, | 30 const fileapi::FileSystemURL& url, |
22 const EnsureFileExistsCallback& callback) OVERRIDE; | 31 const EnsureFileExistsCallback& callback) OVERRIDE; |
23 virtual void CreateDirectory( | 32 virtual void CreateDirectory( |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
72 const fileapi::FileSystemURL& url, | 81 const fileapi::FileSystemURL& url, |
73 const StatusCallback& callback) OVERRIDE; | 82 const StatusCallback& callback) OVERRIDE; |
74 virtual void DeleteRecursively( | 83 virtual void DeleteRecursively( |
75 scoped_ptr<fileapi::FileSystemOperationContext> context, | 84 scoped_ptr<fileapi::FileSystemOperationContext> context, |
76 const fileapi::FileSystemURL& url, | 85 const fileapi::FileSystemURL& url, |
77 const StatusCallback& callback) OVERRIDE; | 86 const StatusCallback& callback) OVERRIDE; |
78 virtual void CreateSnapshotFile( | 87 virtual void CreateSnapshotFile( |
79 scoped_ptr<fileapi::FileSystemOperationContext> context, | 88 scoped_ptr<fileapi::FileSystemOperationContext> context, |
80 const fileapi::FileSystemURL& url, | 89 const fileapi::FileSystemURL& url, |
81 const CreateSnapshotFileCallback& callback) OVERRIDE; | 90 const CreateSnapshotFileCallback& callback) OVERRIDE; |
| 91 |
| 92 |
| 93 virtual void RemoveOperation( |
| 94 PrivetFileSystemAsyncOperation* operation) OVERRIDE; |
| 95 virtual void RemoveAllOperations() OVERRIDE; |
| 96 |
| 97 private: |
| 98 |
| 99 std::set<PrivetFileSystemAsyncOperation*> async_operations_; |
| 100 content::BrowserContext* browser_context_; |
82 }; | 101 }; |
83 | 102 |
84 } // namespace local_discovery | 103 } // namespace local_discovery |
85 | 104 |
86 #endif // CHROME_BROWSER_LOCAL_DISCOVERY_STORAGE_PRIVET_FILESYSTEM_ASYNC_UTIL_H
_ | 105 #endif // CHROME_BROWSER_LOCAL_DISCOVERY_STORAGE_PRIVET_FILESYSTEM_ASYNC_UTIL_H
_ |
OLD | NEW |