Chromium Code Reviews| 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_BROWSER_FILEAPI_TEST_MOUNT_POINT_PROVIDER_H_ | 5 #ifndef WEBKIT_BROWSER_FILEAPI_TEST_MOUNT_POINT_PROVIDER_H_ |
| 6 #define WEBKIT_BROWSER_FILEAPI_TEST_MOUNT_POINT_PROVIDER_H_ | 6 #define WEBKIT_BROWSER_FILEAPI_TEST_MOUNT_POINT_PROVIDER_H_ |
| 7 | 7 |
| 8 #include "base/files/file_path.h" | 8 #include "base/files/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 30 matching lines...) Expand all Loading... | |
| 41 bool create, | 41 bool create, |
| 42 const ValidateFileSystemCallback& callback) OVERRIDE; | 42 const ValidateFileSystemCallback& callback) OVERRIDE; |
| 43 virtual base::FilePath GetFileSystemRootPathOnFileThread( | 43 virtual base::FilePath GetFileSystemRootPathOnFileThread( |
| 44 const FileSystemURL& url, | 44 const FileSystemURL& url, |
| 45 bool create) OVERRIDE; | 45 bool create) OVERRIDE; |
| 46 virtual FileSystemFileUtil* GetFileUtil(FileSystemType type) OVERRIDE; | 46 virtual FileSystemFileUtil* GetFileUtil(FileSystemType type) OVERRIDE; |
| 47 virtual AsyncFileUtil* GetAsyncFileUtil(FileSystemType type) OVERRIDE; | 47 virtual AsyncFileUtil* GetAsyncFileUtil(FileSystemType type) OVERRIDE; |
| 48 virtual CopyOrMoveFileValidatorFactory* GetCopyOrMoveFileValidatorFactory( | 48 virtual CopyOrMoveFileValidatorFactory* GetCopyOrMoveFileValidatorFactory( |
| 49 FileSystemType type, | 49 FileSystemType type, |
| 50 base::PlatformFileError* error_code) OVERRIDE; | 50 base::PlatformFileError* error_code) OVERRIDE; |
| 51 virtual void InitializeCopyOrMoveFileValidatorFactory( | |
| 52 FileSystemType type, | |
| 53 scoped_ptr<CopyOrMoveFileValidatorFactory> factory) OVERRIDE; | |
| 54 virtual FilePermissionPolicy GetPermissionPolicy( | 51 virtual FilePermissionPolicy GetPermissionPolicy( |
| 55 const FileSystemURL& url, | 52 const FileSystemURL& url, |
| 56 int permissions) const OVERRIDE; | 53 int permissions) const OVERRIDE; |
| 57 virtual FileSystemOperation* CreateFileSystemOperation( | 54 virtual FileSystemOperation* CreateFileSystemOperation( |
| 58 const FileSystemURL& url, | 55 const FileSystemURL& url, |
| 59 FileSystemContext* context, | 56 FileSystemContext* context, |
| 60 base::PlatformFileError* error_code) const OVERRIDE; | 57 base::PlatformFileError* error_code) const OVERRIDE; |
| 61 virtual scoped_ptr<webkit_blob::FileStreamReader> CreateFileStreamReader( | 58 virtual scoped_ptr<webkit_blob::FileStreamReader> CreateFileStreamReader( |
| 62 const FileSystemURL& url, | 59 const FileSystemURL& url, |
| 63 int64 offset, | 60 int64 offset, |
| 64 const base::Time& expected_modification_time, | 61 const base::Time& expected_modification_time, |
| 65 FileSystemContext* context) const OVERRIDE; | 62 FileSystemContext* context) const OVERRIDE; |
| 66 virtual scoped_ptr<FileStreamWriter> CreateFileStreamWriter( | 63 virtual scoped_ptr<FileStreamWriter> CreateFileStreamWriter( |
| 67 const FileSystemURL& url, | 64 const FileSystemURL& url, |
| 68 int64 offset, | 65 int64 offset, |
| 69 FileSystemContext* context) const OVERRIDE; | 66 FileSystemContext* context) const OVERRIDE; |
| 70 virtual FileSystemQuotaUtil* GetQuotaUtil() OVERRIDE; | 67 virtual FileSystemQuotaUtil* GetQuotaUtil() OVERRIDE; |
| 71 virtual void DeleteFileSystem( | 68 virtual void DeleteFileSystem( |
| 72 const GURL& origin_url, | 69 const GURL& origin_url, |
| 73 FileSystemType type, | 70 FileSystemType type, |
| 74 FileSystemContext* context, | 71 FileSystemContext* context, |
| 75 const DeleteFileSystemCallback& callback) OVERRIDE; | 72 const DeleteFileSystemCallback& callback) OVERRIDE; |
| 76 | 73 |
| 74 // Initialize the CopyOrMoveFileValidatorFactory. Invalid to call more than | |
| 75 // once. | |
| 76 virtual void InitializeCopyOrMoveFileValidatorFactory( | |
| 77 scoped_ptr<CopyOrMoveFileValidatorFactory> factory); | |
|
kinuko
2013/05/29 01:35:21
nit: does this need to be virtual?
Lei Zhang
2013/05/29 01:37:21
Nope, fixed.
| |
| 78 | |
| 77 const UpdateObserverList* GetUpdateObservers(FileSystemType type) const; | 79 const UpdateObserverList* GetUpdateObservers(FileSystemType type) const; |
| 78 | 80 |
| 79 // For CopyOrMoveFileValidatorFactory testing. Once it's set to true | 81 // For CopyOrMoveFileValidatorFactory testing. Once it's set to true |
| 80 // GetCopyOrMoveFileValidatorFactory will start returning security | 82 // GetCopyOrMoveFileValidatorFactory will start returning security |
| 81 // error if validator is not initialized. | 83 // error if validator is not initialized. |
| 82 void set_require_copy_or_move_validator(bool flag) { | 84 void set_require_copy_or_move_validator(bool flag) { |
| 83 require_copy_or_move_validator_ = flag; | 85 require_copy_or_move_validator_ = flag; |
| 84 } | 86 } |
| 85 | 87 |
| 86 private: | 88 private: |
| 87 class QuotaUtil; | 89 class QuotaUtil; |
| 88 | 90 |
| 89 base::FilePath base_path_; | 91 base::FilePath base_path_; |
| 90 scoped_refptr<base::SequencedTaskRunner> task_runner_; | 92 scoped_refptr<base::SequencedTaskRunner> task_runner_; |
| 91 scoped_ptr<AsyncFileUtilAdapter> local_file_util_; | 93 scoped_ptr<AsyncFileUtilAdapter> local_file_util_; |
| 92 scoped_ptr<QuotaUtil> quota_util_; | 94 scoped_ptr<QuotaUtil> quota_util_; |
| 93 UpdateObserverList observers_; | 95 UpdateObserverList observers_; |
| 94 | 96 |
| 95 bool require_copy_or_move_validator_; | 97 bool require_copy_or_move_validator_; |
| 96 scoped_ptr<CopyOrMoveFileValidatorFactory> | 98 scoped_ptr<CopyOrMoveFileValidatorFactory> |
| 97 copy_or_move_file_validator_factory_; | 99 copy_or_move_file_validator_factory_; |
| 98 | 100 |
| 99 DISALLOW_COPY_AND_ASSIGN(TestMountPointProvider); | 101 DISALLOW_COPY_AND_ASSIGN(TestMountPointProvider); |
| 100 }; | 102 }; |
| 101 | 103 |
| 102 } // namespace fileapi | 104 } // namespace fileapi |
| 103 | 105 |
| 104 #endif // WEBKIT_BROWSER_FILEAPI_TEST_MOUNT_POINT_PROVIDER_H_ | 106 #endif // WEBKIT_BROWSER_FILEAPI_TEST_MOUNT_POINT_PROVIDER_H_ |
| OLD | NEW |