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_CHROMEOS_FILEAPI_FILE_SYSTEM_BACKEND_DELEGATE_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_FILEAPI_FILE_SYSTEM_BACKEND_DELEGATE_H_ |
6 #define CHROME_BROWSER_CHROMEOS_FILEAPI_FILE_SYSTEM_BACKEND_DELEGATE_H_ | 6 #define CHROME_BROWSER_CHROMEOS_FILEAPI_FILE_SYSTEM_BACKEND_DELEGATE_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "webkit/common/fileapi/file_system_types.h" | 10 #include "webkit/common/fileapi/file_system_types.h" |
11 | 11 |
12 namespace base { | 12 namespace base { |
13 class Time; | 13 class Time; |
14 } // namespace base | 14 } // namespace base |
15 | 15 |
16 namespace storage { | 16 namespace storage { |
17 class AsyncFileUtil; | 17 class AsyncFileUtil; |
18 class FileSystemContext; | 18 class FileSystemContext; |
| 19 class FileStreamReader; |
19 class FileSystemURL; | 20 class FileSystemURL; |
20 class FileStreamWriter; | 21 class FileStreamWriter; |
| 22 class WatcherManager; |
21 } // namespace storage | 23 } // namespace storage |
22 | 24 |
23 namespace storage { | 25 namespace storage { |
24 class FileStreamReader; | 26 class FileStreamReader; |
25 } // namespace storage | 27 } // namespace storage |
26 | 28 |
27 namespace chromeos { | 29 namespace chromeos { |
28 | 30 |
29 // This is delegate interface to inject the implementation of the some methods | 31 // This is delegate interface to inject the implementation of the some methods |
30 // of FileSystemBackend. The main goal is to inject Drive File System. | 32 // of FileSystemBackend. |
31 class FileSystemBackendDelegate { | 33 class FileSystemBackendDelegate { |
32 public: | 34 public: |
33 virtual ~FileSystemBackendDelegate() {} | 35 virtual ~FileSystemBackendDelegate() {} |
34 | 36 |
35 // Called from FileSystemBackend::GetAsyncFileUtil(). | 37 // Called from FileSystemBackend::GetAsyncFileUtil(). |
36 virtual storage::AsyncFileUtil* GetAsyncFileUtil( | 38 virtual storage::AsyncFileUtil* GetAsyncFileUtil( |
37 storage::FileSystemType type) = 0; | 39 storage::FileSystemType type) = 0; |
38 | 40 |
39 // Called from FileSystemBackend::CreateFileStreamReader(). | 41 // Called from FileSystemBackend::CreateFileStreamReader(). |
40 virtual scoped_ptr<storage::FileStreamReader> CreateFileStreamReader( | 42 virtual scoped_ptr<storage::FileStreamReader> CreateFileStreamReader( |
41 const storage::FileSystemURL& url, | 43 const storage::FileSystemURL& url, |
42 int64 offset, | 44 int64 offset, |
43 const base::Time& expected_modification_time, | 45 const base::Time& expected_modification_time, |
44 storage::FileSystemContext* context) = 0; | 46 storage::FileSystemContext* context) = 0; |
45 | 47 |
46 // Called from FileSystemBackend::CreateFileStreamWriter(). | 48 // Called from FileSystemBackend::CreateFileStreamWriter(). |
47 virtual scoped_ptr<storage::FileStreamWriter> CreateFileStreamWriter( | 49 virtual scoped_ptr<storage::FileStreamWriter> CreateFileStreamWriter( |
48 const storage::FileSystemURL& url, | 50 const storage::FileSystemURL& url, |
49 int64 offset, | 51 int64 offset, |
50 storage::FileSystemContext* context) = 0; | 52 storage::FileSystemContext* context) = 0; |
| 53 |
| 54 // Called from the FileSystemWatcherService class. The returned pointer must |
| 55 // stay valid until shutdown. |
| 56 virtual storage::WatcherManager* GetWatcherManager( |
| 57 const storage::FileSystemURL& url) = 0; |
51 }; | 58 }; |
52 | 59 |
53 } // namespace chromeos | 60 } // namespace chromeos |
54 | 61 |
55 #endif // CHROME_BROWSER_CHROMEOS_FILEAPI_FILE_SYSTEM_BACKEND_DELEGATE_H_ | 62 #endif // CHROME_BROWSER_CHROMEOS_FILEAPI_FILE_SYSTEM_BACKEND_DELEGATE_H_ |
OLD | NEW |