| 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_TEST_MOUNT_POINT_PROVIDER_H_ | 5 #ifndef WEBKIT_FILEAPI_TEST_MOUNT_POINT_PROVIDER_H_ |
| 6 #define WEBKIT_FILEAPI_TEST_MOUNT_POINT_PROVIDER_H_ | 6 #define WEBKIT_FILEAPI_TEST_MOUNT_POINT_PROVIDER_H_ |
| 7 | 7 |
| 8 #include "base/file_path.h" | 8 #include "base/file_path.h" |
| 9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
| 10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 class FileSystemQuotaUtil; | 21 class FileSystemQuotaUtil; |
| 22 | 22 |
| 23 // This should be only used for testing. | 23 // This should be only used for testing. |
| 24 // This mount point provider uses LocalFileUtil and stores data file | 24 // This mount point provider uses LocalFileUtil and stores data file |
| 25 // under the given directory. | 25 // under the given directory. |
| 26 class FILEAPI_EXPORT_PRIVATE TestMountPointProvider | 26 class FILEAPI_EXPORT_PRIVATE TestMountPointProvider |
| 27 : public FileSystemMountPointProvider { | 27 : public FileSystemMountPointProvider { |
| 28 public: | 28 public: |
| 29 typedef FileSystemMountPointProvider::ValidateFileSystemCallback | 29 typedef FileSystemMountPointProvider::ValidateFileSystemCallback |
| 30 ValidateFileSystemCallback; | 30 ValidateFileSystemCallback; |
| 31 typedef FileSystemMountPointProvider::DeleteFileSystemCallback |
| 32 DeleteFileSystemCallback; |
| 31 | 33 |
| 32 TestMountPointProvider( | 34 TestMountPointProvider( |
| 33 base::SequencedTaskRunner* task_runner, | 35 base::SequencedTaskRunner* task_runner, |
| 34 const FilePath& base_path); | 36 const FilePath& base_path); |
| 35 virtual ~TestMountPointProvider(); | 37 virtual ~TestMountPointProvider(); |
| 36 | 38 |
| 37 // FileSystemMountPointProvider implementation. | 39 // FileSystemMountPointProvider implementation. |
| 38 virtual void ValidateFileSystemRoot( | 40 virtual void ValidateFileSystemRoot( |
| 39 const GURL& origin_url, | 41 const GURL& origin_url, |
| 40 FileSystemType type, | 42 FileSystemType type, |
| 41 bool create, | 43 bool create, |
| 42 const ValidateFileSystemCallback& callback) OVERRIDE; | 44 const ValidateFileSystemCallback& callback) OVERRIDE; |
| 43 virtual FilePath GetFileSystemRootPathOnFileThread( | 45 virtual FilePath GetFileSystemRootPathOnFileThread( |
| 44 const GURL& origin_url, | 46 const GURL& origin_url, |
| 45 FileSystemType type, | 47 FileSystemType type, |
| 46 const FilePath& virtual_path, | 48 const FilePath& virtual_path, |
| 47 bool create) OVERRIDE; | 49 bool create) OVERRIDE; |
| 48 virtual bool IsAccessAllowed(const GURL& origin_url, | 50 virtual bool IsAccessAllowed(const GURL& origin_url, |
| 49 FileSystemType type, | 51 FileSystemType type, |
| 50 const FilePath& virtual_path) OVERRIDE; | 52 const FilePath& virtual_path) OVERRIDE; |
| 51 virtual bool IsRestrictedFileName(const FilePath& filename) const OVERRIDE; | 53 virtual bool IsRestrictedFileName(const FilePath& filename) const OVERRIDE; |
| 52 virtual FileSystemFileUtil* GetFileUtil(FileSystemType type) OVERRIDE; | 54 virtual FileSystemFileUtil* GetFileUtil(FileSystemType type) OVERRIDE; |
| 53 virtual FilePath GetPathForPermissionsCheck(const FilePath& virtual_path) | 55 virtual FilePath GetPathForPermissionsCheck(const FilePath& virtual_path) |
| 54 const OVERRIDE; | 56 const OVERRIDE; |
| 55 virtual FileSystemOperationInterface* CreateFileSystemOperation( | 57 virtual FileSystemOperationInterface* CreateFileSystemOperation( |
| 56 const FileSystemURL& url, | 58 const FileSystemURL& url, |
| 57 FileSystemContext* context) const OVERRIDE; | 59 FileSystemContext* context) const OVERRIDE; |
| 58 virtual webkit_blob::FileStreamReader* CreateFileStreamReader( | 60 virtual webkit_blob::FileStreamReader* CreateFileStreamReader( |
| 59 const FileSystemURL& url, | 61 const FileSystemURL& url, |
| 60 int64 offset, | 62 int64 offset, |
| 61 FileSystemContext* context) const OVERRIDE; | 63 FileSystemContext* context) const OVERRIDE; |
| 62 virtual FileStreamWriter* CreateFileStreamWriter( | 64 virtual FileStreamWriter* CreateFileStreamWriter( |
| 63 const FileSystemURL& url, | 65 const FileSystemURL& url, |
| 64 int64 offset, | 66 int64 offset, |
| 65 FileSystemContext* context) const OVERRIDE; | 67 FileSystemContext* context) const OVERRIDE; |
| 66 virtual FileSystemQuotaUtil* GetQuotaUtil() OVERRIDE; | 68 virtual FileSystemQuotaUtil* GetQuotaUtil() OVERRIDE; |
| 69 virtual void DeleteFileSystem( |
| 70 const GURL& origin_url, |
| 71 FileSystemType type, |
| 72 FileSystemContext* context, |
| 73 const DeleteFileSystemCallback& callback) const OVERRIDE; |
| 67 | 74 |
| 68 private: | 75 private: |
| 69 FilePath base_path_; | 76 FilePath base_path_; |
| 70 scoped_ptr<LocalFileUtil> local_file_util_; | 77 scoped_ptr<LocalFileUtil> local_file_util_; |
| 71 scoped_ptr<FileSystemQuotaUtil> quota_util_; | 78 scoped_ptr<FileSystemQuotaUtil> quota_util_; |
| 72 }; | 79 }; |
| 73 | 80 |
| 74 } // namespace fileapi | 81 } // namespace fileapi |
| 75 | 82 |
| 76 #endif // WEBKIT_FILEAPI_TEST_MOUNT_POINT_PROVIDER_H_ | 83 #endif // WEBKIT_FILEAPI_TEST_MOUNT_POINT_PROVIDER_H_ |
| OLD | NEW |