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 STORAGE_BROWSER_FILEAPI_FILE_SYSTEM_BACKEND_H_ | 5 #ifndef STORAGE_BROWSER_FILEAPI_FILE_SYSTEM_BACKEND_H_ |
6 #define STORAGE_BROWSER_FILEAPI_FILE_SYSTEM_BACKEND_H_ | 6 #define STORAGE_BROWSER_FILEAPI_FILE_SYSTEM_BACKEND_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
11 #include "base/callback_forward.h" | 11 #include "base/callback_forward.h" |
12 #include "base/files/file.h" | 12 #include "base/files/file.h" |
13 #include "base/files/file_path.h" | 13 #include "base/files/file_path.h" |
14 #include "base/memory/scoped_ptr.h" | 14 #include "base/memory/scoped_ptr.h" |
15 #include "storage/browser/fileapi/file_permission_policy.h" | 15 #include "storage/browser/fileapi/file_permission_policy.h" |
16 #include "storage/browser/fileapi/open_file_system_mode.h" | 16 #include "storage/browser/fileapi/open_file_system_mode.h" |
| 17 #include "storage/browser/fileapi/task_runner_bound_observer_list.h" |
17 #include "storage/browser/storage_browser_export.h" | 18 #include "storage/browser/storage_browser_export.h" |
18 #include "storage/common/fileapi/file_system_types.h" | 19 #include "storage/common/fileapi/file_system_types.h" |
19 | 20 |
20 class GURL; | 21 class GURL; |
21 | 22 |
22 namespace storage { | 23 namespace storage { |
23 | 24 |
24 class AsyncFileUtil; | 25 class AsyncFileUtil; |
25 class CopyOrMoveFileValidatorFactory; | 26 class CopyOrMoveFileValidatorFactory; |
26 class FileSystemURL; | 27 class FileSystemURL; |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
122 // This method itself does *not* check if the given path exists and is a | 123 // This method itself does *not* check if the given path exists and is a |
123 // regular file. | 124 // regular file. |
124 virtual scoped_ptr<FileStreamWriter> CreateFileStreamWriter( | 125 virtual scoped_ptr<FileStreamWriter> CreateFileStreamWriter( |
125 const FileSystemURL& url, | 126 const FileSystemURL& url, |
126 int64 offset, | 127 int64 offset, |
127 FileSystemContext* context) const = 0; | 128 FileSystemContext* context) const = 0; |
128 | 129 |
129 // Returns the specialized FileSystemQuotaUtil for this backend. | 130 // Returns the specialized FileSystemQuotaUtil for this backend. |
130 // This could return NULL if this backend does not support quota. | 131 // This could return NULL if this backend does not support quota. |
131 virtual FileSystemQuotaUtil* GetQuotaUtil() = 0; | 132 virtual FileSystemQuotaUtil* GetQuotaUtil() = 0; |
| 133 |
| 134 // Returns the update observer list for |type|. It may return NULL when no |
| 135 // observers are added. |
| 136 virtual const UpdateObserverList* GetUpdateObservers( |
| 137 FileSystemType type) const = 0; |
| 138 |
| 139 // Returns the change observer list for |type|. It may return NULL when no |
| 140 // observers are added. |
| 141 virtual const ChangeObserverList* GetChangeObservers( |
| 142 FileSystemType type) const = 0; |
| 143 |
| 144 // Returns the access observer list for |type|. It may return NULL when no |
| 145 // observers are added. |
| 146 virtual const AccessObserverList* GetAccessObservers( |
| 147 FileSystemType type) const = 0; |
132 }; | 148 }; |
133 | 149 |
134 // An interface to control external file system access permissions. | 150 // An interface to control external file system access permissions. |
135 // TODO(satorux): Move this out of 'storage/browser/fileapi'. crbug.com/257279 | 151 // TODO(satorux): Move this out of 'storage/browser/fileapi'. crbug.com/257279 |
136 class ExternalFileSystemBackend : public FileSystemBackend { | 152 class ExternalFileSystemBackend : public FileSystemBackend { |
137 public: | 153 public: |
138 // Returns true if |url| is allowed to be accessed. | 154 // Returns true if |url| is allowed to be accessed. |
139 // This is supposed to perform ExternalFileSystem-specific security | 155 // This is supposed to perform ExternalFileSystem-specific security |
140 // checks. | 156 // checks. |
141 virtual bool IsAccessAllowed(const storage::FileSystemURL& url) const = 0; | 157 virtual bool IsAccessAllowed(const storage::FileSystemURL& url) const = 0; |
(...skipping 18 matching lines...) Expand all Loading... |
160 // Gets a redirect URL for contents. e.g. Google Drive URL for hosted | 176 // Gets a redirect URL for contents. e.g. Google Drive URL for hosted |
161 // documents. Returns empty URL if the entry does not have the redirect URL. | 177 // documents. Returns empty URL if the entry does not have the redirect URL. |
162 virtual void GetRedirectURLForContents( | 178 virtual void GetRedirectURLForContents( |
163 const storage::FileSystemURL& url, | 179 const storage::FileSystemURL& url, |
164 const storage::URLCallback& callback) = 0; | 180 const storage::URLCallback& callback) = 0; |
165 }; | 181 }; |
166 | 182 |
167 } // namespace storage | 183 } // namespace storage |
168 | 184 |
169 #endif // STORAGE_BROWSER_FILEAPI_FILE_SYSTEM_BACKEND_H_ | 185 #endif // STORAGE_BROWSER_FILEAPI_FILE_SYSTEM_BACKEND_H_ |
OLD | NEW |