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 STORAGE_BROWSER_TEST_TEST_FILE_SYSTEM_BACKEND_H_ |
6 #define CONTENT_PUBLIC_TEST_TEST_FILE_SYSTEM_BACKEND_H_ | 6 #define STORAGE_BROWSER_TEST_TEST_FILE_SYSTEM_BACKEND_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <memory> | 10 #include <memory> |
11 | 11 |
12 #include "base/files/file_path.h" | 12 #include "base/files/file_path.h" |
13 #include "base/macros.h" | 13 #include "base/macros.h" |
14 #include "base/memory/ref_counted.h" | 14 #include "base/memory/ref_counted.h" |
15 #include "storage/browser/fileapi/async_file_util_adapter.h" | 15 #include "storage/browser/fileapi/async_file_util_adapter.h" |
16 #include "storage/browser/fileapi/file_system_backend.h" | 16 #include "storage/browser/fileapi/file_system_backend.h" |
17 #include "storage/browser/fileapi/task_runner_bound_observer_list.h" | 17 #include "storage/browser/fileapi/task_runner_bound_observer_list.h" |
18 | 18 |
19 namespace base { | 19 namespace base { |
20 class SequencedTaskRunner; | 20 class SequencedTaskRunner; |
21 } | 21 } |
22 | 22 |
23 namespace storage { | 23 namespace storage { |
24 class AsyncFileUtilAdapter; | 24 class AsyncFileUtilAdapter; |
25 class FileSystemQuotaUtil; | 25 class FileSystemQuotaUtil; |
26 } | 26 } |
27 | 27 |
28 namespace content { | 28 namespace content { |
29 | 29 |
30 // This should be only used for testing. | 30 // This should be only used for testing. |
31 // This file system backend uses LocalFileUtil and stores data file | 31 // This file system backend uses LocalFileUtil and stores data file |
32 // under the given directory. | 32 // under the given directory. |
33 class TestFileSystemBackend : public storage::FileSystemBackend { | 33 class TestFileSystemBackend : public storage::FileSystemBackend { |
34 public: | 34 public: |
35 TestFileSystemBackend( | 35 TestFileSystemBackend(base::SequencedTaskRunner* task_runner, |
36 base::SequencedTaskRunner* task_runner, | 36 const base::FilePath& base_path); |
37 const base::FilePath& base_path); | |
38 ~TestFileSystemBackend() override; | 37 ~TestFileSystemBackend() override; |
39 | 38 |
40 // FileSystemBackend implementation. | 39 // FileSystemBackend implementation. |
41 bool CanHandleType(storage::FileSystemType type) const override; | 40 bool CanHandleType(storage::FileSystemType type) const override; |
42 void Initialize(storage::FileSystemContext* context) override; | 41 void Initialize(storage::FileSystemContext* context) override; |
43 void ResolveURL(const storage::FileSystemURL& url, | 42 void ResolveURL(const storage::FileSystemURL& url, |
44 storage::OpenFileSystemMode mode, | 43 storage::OpenFileSystemMode mode, |
45 const OpenFileSystemCallback& callback) override; | 44 const OpenFileSystemCallback& callback) override; |
46 storage::AsyncFileUtil* GetAsyncFileUtil( | 45 storage::AsyncFileUtil* GetAsyncFileUtil( |
47 storage::FileSystemType type) override; | 46 storage::FileSystemType type) override; |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
101 | 100 |
102 bool require_copy_or_move_validator_; | 101 bool require_copy_or_move_validator_; |
103 std::unique_ptr<storage::CopyOrMoveFileValidatorFactory> | 102 std::unique_ptr<storage::CopyOrMoveFileValidatorFactory> |
104 copy_or_move_file_validator_factory_; | 103 copy_or_move_file_validator_factory_; |
105 | 104 |
106 DISALLOW_COPY_AND_ASSIGN(TestFileSystemBackend); | 105 DISALLOW_COPY_AND_ASSIGN(TestFileSystemBackend); |
107 }; | 106 }; |
108 | 107 |
109 } // namespace content | 108 } // namespace content |
110 | 109 |
111 #endif // CONTENT_PUBLIC_TEST_TEST_FILE_SYSTEM_BACKEND_H_ | 110 #endif // STORAGE_BROWSER_TEST_TEST_FILE_SYSTEM_BACKEND_H_ |
OLD | NEW |