| 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_SANDBOX_FILE_SYSTEM_BACKEND_H_ | 5 #ifndef STORAGE_BROWSER_FILEAPI_SANDBOX_FILE_SYSTEM_BACKEND_H_ |
| 6 #define STORAGE_BROWSER_FILEAPI_SANDBOX_FILE_SYSTEM_BACKEND_H_ | 6 #define STORAGE_BROWSER_FILEAPI_SANDBOX_FILE_SYSTEM_BACKEND_H_ |
| 7 | 7 |
| 8 #include <set> | 8 #include <set> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 // profile directory in a sandboxed way. | 25 // profile directory in a sandboxed way. |
| 26 // This interface also lets one enumerate and remove storage for the origins | 26 // This interface also lets one enumerate and remove storage for the origins |
| 27 // that use the filesystem. | 27 // that use the filesystem. |
| 28 class STORAGE_EXPORT SandboxFileSystemBackend | 28 class STORAGE_EXPORT SandboxFileSystemBackend |
| 29 : public FileSystemBackend { | 29 : public FileSystemBackend { |
| 30 public: | 30 public: |
| 31 explicit SandboxFileSystemBackend(SandboxFileSystemBackendDelegate* delegate); | 31 explicit SandboxFileSystemBackend(SandboxFileSystemBackendDelegate* delegate); |
| 32 virtual ~SandboxFileSystemBackend(); | 32 virtual ~SandboxFileSystemBackend(); |
| 33 | 33 |
| 34 // FileSystemBackend overrides. | 34 // FileSystemBackend overrides. |
| 35 virtual bool CanHandleType(FileSystemType type) const OVERRIDE; | 35 virtual bool CanHandleType(FileSystemType type) const override; |
| 36 virtual void Initialize(FileSystemContext* context) OVERRIDE; | 36 virtual void Initialize(FileSystemContext* context) override; |
| 37 virtual void ResolveURL(const FileSystemURL& url, | 37 virtual void ResolveURL(const FileSystemURL& url, |
| 38 OpenFileSystemMode mode, | 38 OpenFileSystemMode mode, |
| 39 const OpenFileSystemCallback& callback) OVERRIDE; | 39 const OpenFileSystemCallback& callback) override; |
| 40 virtual AsyncFileUtil* GetAsyncFileUtil(FileSystemType type) OVERRIDE; | 40 virtual AsyncFileUtil* GetAsyncFileUtil(FileSystemType type) override; |
| 41 virtual WatcherManager* GetWatcherManager(FileSystemType type) OVERRIDE; | 41 virtual WatcherManager* GetWatcherManager(FileSystemType type) override; |
| 42 virtual CopyOrMoveFileValidatorFactory* GetCopyOrMoveFileValidatorFactory( | 42 virtual CopyOrMoveFileValidatorFactory* GetCopyOrMoveFileValidatorFactory( |
| 43 FileSystemType type, | 43 FileSystemType type, |
| 44 base::File::Error* error_code) OVERRIDE; | 44 base::File::Error* error_code) override; |
| 45 virtual FileSystemOperation* CreateFileSystemOperation( | 45 virtual FileSystemOperation* CreateFileSystemOperation( |
| 46 const FileSystemURL& url, | 46 const FileSystemURL& url, |
| 47 FileSystemContext* context, | 47 FileSystemContext* context, |
| 48 base::File::Error* error_code) const OVERRIDE; | 48 base::File::Error* error_code) const override; |
| 49 virtual bool SupportsStreaming(const FileSystemURL& url) const OVERRIDE; | 49 virtual bool SupportsStreaming(const FileSystemURL& url) const override; |
| 50 virtual bool HasInplaceCopyImplementation( | 50 virtual bool HasInplaceCopyImplementation( |
| 51 storage::FileSystemType type) const OVERRIDE; | 51 storage::FileSystemType type) const override; |
| 52 virtual scoped_ptr<storage::FileStreamReader> CreateFileStreamReader( | 52 virtual scoped_ptr<storage::FileStreamReader> CreateFileStreamReader( |
| 53 const FileSystemURL& url, | 53 const FileSystemURL& url, |
| 54 int64 offset, | 54 int64 offset, |
| 55 int64 max_bytes_to_read, | 55 int64 max_bytes_to_read, |
| 56 const base::Time& expected_modification_time, | 56 const base::Time& expected_modification_time, |
| 57 FileSystemContext* context) const OVERRIDE; | 57 FileSystemContext* context) const override; |
| 58 virtual scoped_ptr<FileStreamWriter> CreateFileStreamWriter( | 58 virtual scoped_ptr<FileStreamWriter> CreateFileStreamWriter( |
| 59 const FileSystemURL& url, | 59 const FileSystemURL& url, |
| 60 int64 offset, | 60 int64 offset, |
| 61 FileSystemContext* context) const OVERRIDE; | 61 FileSystemContext* context) const override; |
| 62 virtual FileSystemQuotaUtil* GetQuotaUtil() OVERRIDE; | 62 virtual FileSystemQuotaUtil* GetQuotaUtil() override; |
| 63 virtual const UpdateObserverList* GetUpdateObservers( | 63 virtual const UpdateObserverList* GetUpdateObservers( |
| 64 FileSystemType type) const OVERRIDE; | 64 FileSystemType type) const override; |
| 65 virtual const ChangeObserverList* GetChangeObservers( | 65 virtual const ChangeObserverList* GetChangeObservers( |
| 66 FileSystemType type) const OVERRIDE; | 66 FileSystemType type) const override; |
| 67 virtual const AccessObserverList* GetAccessObservers( | 67 virtual const AccessObserverList* GetAccessObservers( |
| 68 FileSystemType type) const OVERRIDE; | 68 FileSystemType type) const override; |
| 69 | 69 |
| 70 // Returns an origin enumerator of this backend. | 70 // Returns an origin enumerator of this backend. |
| 71 // This method can only be called on the file thread. | 71 // This method can only be called on the file thread. |
| 72 SandboxFileSystemBackendDelegate::OriginEnumerator* CreateOriginEnumerator(); | 72 SandboxFileSystemBackendDelegate::OriginEnumerator* CreateOriginEnumerator(); |
| 73 | 73 |
| 74 void set_enable_temporary_file_system_in_incognito(bool enable) { | 74 void set_enable_temporary_file_system_in_incognito(bool enable) { |
| 75 enable_temporary_file_system_in_incognito_ = enable; | 75 enable_temporary_file_system_in_incognito_ = enable; |
| 76 } | 76 } |
| 77 bool enable_temporary_file_system_in_incognito() const { | 77 bool enable_temporary_file_system_in_incognito() const { |
| 78 return enable_temporary_file_system_in_incognito_; | 78 return enable_temporary_file_system_in_incognito_; |
| 79 } | 79 } |
| 80 | 80 |
| 81 | 81 |
| 82 private: | 82 private: |
| 83 SandboxFileSystemBackendDelegate* delegate_; // Not owned. | 83 SandboxFileSystemBackendDelegate* delegate_; // Not owned. |
| 84 | 84 |
| 85 bool enable_temporary_file_system_in_incognito_; | 85 bool enable_temporary_file_system_in_incognito_; |
| 86 | 86 |
| 87 DISALLOW_COPY_AND_ASSIGN(SandboxFileSystemBackend); | 87 DISALLOW_COPY_AND_ASSIGN(SandboxFileSystemBackend); |
| 88 }; | 88 }; |
| 89 | 89 |
| 90 } // namespace storage | 90 } // namespace storage |
| 91 | 91 |
| 92 #endif // STORAGE_BROWSER_FILEAPI_SANDBOX_FILE_SYSTEM_BACKEND_H_ | 92 #endif // STORAGE_BROWSER_FILEAPI_SANDBOX_FILE_SYSTEM_BACKEND_H_ |
| OLD | NEW |