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 CONTENT_PUBLIC_TEST_TEST_FILE_SYSTEM_BACKEND_H_ | 5 #ifndef CONTENT_PUBLIC_TEST_TEST_FILE_SYSTEM_BACKEND_H_ |
6 #define CONTENT_PUBLIC_TEST_TEST_FILE_SYSTEM_BACKEND_H_ | 6 #define CONTENT_PUBLIC_TEST_TEST_FILE_SYSTEM_BACKEND_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 13 matching lines...) Expand all Loading... |
24 namespace content { | 24 namespace content { |
25 | 25 |
26 // This should be only used for testing. | 26 // This should be only used for testing. |
27 // This file system backend uses LocalFileUtil and stores data file | 27 // This file system backend uses LocalFileUtil and stores data file |
28 // under the given directory. | 28 // under the given directory. |
29 class TestFileSystemBackend : public storage::FileSystemBackend { | 29 class TestFileSystemBackend : public storage::FileSystemBackend { |
30 public: | 30 public: |
31 TestFileSystemBackend( | 31 TestFileSystemBackend( |
32 base::SequencedTaskRunner* task_runner, | 32 base::SequencedTaskRunner* task_runner, |
33 const base::FilePath& base_path); | 33 const base::FilePath& base_path); |
34 virtual ~TestFileSystemBackend(); | 34 ~TestFileSystemBackend() override; |
35 | 35 |
36 // FileSystemBackend implementation. | 36 // FileSystemBackend implementation. |
37 virtual bool CanHandleType(storage::FileSystemType type) const override; | 37 bool CanHandleType(storage::FileSystemType type) const override; |
38 virtual void Initialize(storage::FileSystemContext* context) override; | 38 void Initialize(storage::FileSystemContext* context) override; |
39 virtual void ResolveURL(const storage::FileSystemURL& url, | 39 void ResolveURL(const storage::FileSystemURL& url, |
40 storage::OpenFileSystemMode mode, | 40 storage::OpenFileSystemMode mode, |
41 const OpenFileSystemCallback& callback) override; | 41 const OpenFileSystemCallback& callback) override; |
42 virtual storage::AsyncFileUtil* GetAsyncFileUtil( | 42 storage::AsyncFileUtil* GetAsyncFileUtil( |
43 storage::FileSystemType type) override; | 43 storage::FileSystemType type) override; |
44 virtual storage::WatcherManager* GetWatcherManager( | 44 storage::WatcherManager* GetWatcherManager( |
45 storage::FileSystemType type) override; | 45 storage::FileSystemType type) override; |
46 virtual storage::CopyOrMoveFileValidatorFactory* | 46 storage::CopyOrMoveFileValidatorFactory* GetCopyOrMoveFileValidatorFactory( |
47 GetCopyOrMoveFileValidatorFactory(storage::FileSystemType type, | 47 storage::FileSystemType type, |
48 base::File::Error* error_code) override; | 48 base::File::Error* error_code) override; |
49 virtual storage::FileSystemOperation* CreateFileSystemOperation( | 49 storage::FileSystemOperation* CreateFileSystemOperation( |
50 const storage::FileSystemURL& url, | 50 const storage::FileSystemURL& url, |
51 storage::FileSystemContext* context, | 51 storage::FileSystemContext* context, |
52 base::File::Error* error_code) const override; | 52 base::File::Error* error_code) const override; |
53 virtual bool SupportsStreaming( | 53 bool SupportsStreaming(const storage::FileSystemURL& url) const override; |
54 const storage::FileSystemURL& url) const override; | 54 bool HasInplaceCopyImplementation( |
55 virtual bool HasInplaceCopyImplementation( | |
56 storage::FileSystemType type) const override; | 55 storage::FileSystemType type) const override; |
57 virtual scoped_ptr<storage::FileStreamReader> CreateFileStreamReader( | 56 scoped_ptr<storage::FileStreamReader> CreateFileStreamReader( |
58 const storage::FileSystemURL& url, | 57 const storage::FileSystemURL& url, |
59 int64 offset, | 58 int64 offset, |
60 int64 max_bytes_to_read, | 59 int64 max_bytes_to_read, |
61 const base::Time& expected_modification_time, | 60 const base::Time& expected_modification_time, |
62 storage::FileSystemContext* context) const override; | 61 storage::FileSystemContext* context) const override; |
63 virtual scoped_ptr<storage::FileStreamWriter> CreateFileStreamWriter( | 62 scoped_ptr<storage::FileStreamWriter> CreateFileStreamWriter( |
64 const storage::FileSystemURL& url, | 63 const storage::FileSystemURL& url, |
65 int64 offset, | 64 int64 offset, |
66 storage::FileSystemContext* context) const override; | 65 storage::FileSystemContext* context) const override; |
67 virtual storage::FileSystemQuotaUtil* GetQuotaUtil() override; | 66 storage::FileSystemQuotaUtil* GetQuotaUtil() override; |
68 virtual const storage::UpdateObserverList* GetUpdateObservers( | 67 const storage::UpdateObserverList* GetUpdateObservers( |
69 storage::FileSystemType type) const override; | 68 storage::FileSystemType type) const override; |
70 virtual const storage::ChangeObserverList* GetChangeObservers( | 69 const storage::ChangeObserverList* GetChangeObservers( |
71 storage::FileSystemType type) const override; | 70 storage::FileSystemType type) const override; |
72 virtual const storage::AccessObserverList* GetAccessObservers( | 71 const storage::AccessObserverList* GetAccessObservers( |
73 storage::FileSystemType type) const override; | 72 storage::FileSystemType type) const override; |
74 | 73 |
75 // Initialize the CopyOrMoveFileValidatorFactory. Invalid to call more than | 74 // Initialize the CopyOrMoveFileValidatorFactory. Invalid to call more than |
76 // once. | 75 // once. |
77 void InitializeCopyOrMoveFileValidatorFactory( | 76 void InitializeCopyOrMoveFileValidatorFactory( |
78 scoped_ptr<storage::CopyOrMoveFileValidatorFactory> factory); | 77 scoped_ptr<storage::CopyOrMoveFileValidatorFactory> factory); |
79 | 78 |
80 void AddFileChangeObserver(storage::FileChangeObserver* observer); | 79 void AddFileChangeObserver(storage::FileChangeObserver* observer); |
81 | 80 |
82 // For CopyOrMoveFileValidatorFactory testing. Once it's set to true | 81 // For CopyOrMoveFileValidatorFactory testing. Once it's set to true |
(...skipping 17 matching lines...) Expand all Loading... |
100 bool require_copy_or_move_validator_; | 99 bool require_copy_or_move_validator_; |
101 scoped_ptr<storage::CopyOrMoveFileValidatorFactory> | 100 scoped_ptr<storage::CopyOrMoveFileValidatorFactory> |
102 copy_or_move_file_validator_factory_; | 101 copy_or_move_file_validator_factory_; |
103 | 102 |
104 DISALLOW_COPY_AND_ASSIGN(TestFileSystemBackend); | 103 DISALLOW_COPY_AND_ASSIGN(TestFileSystemBackend); |
105 }; | 104 }; |
106 | 105 |
107 } // namespace content | 106 } // namespace content |
108 | 107 |
109 #endif // CONTENT_PUBLIC_TEST_TEST_FILE_SYSTEM_BACKEND_H_ | 108 #endif // CONTENT_PUBLIC_TEST_TEST_FILE_SYSTEM_BACKEND_H_ |
OLD | NEW |