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 #include "content/public/test/test_file_system_backend.h" | 5 #include "storage/browser/test/test_file_system_backend.h" |
6 | 6 |
7 #include <set> | 7 #include <set> |
8 #include <string> | 8 #include <string> |
9 #include <utility> | 9 #include <utility> |
10 #include <vector> | 10 #include <vector> |
11 | 11 |
12 #include "base/files/file.h" | 12 #include "base/files/file.h" |
13 #include "base/files/file_util.h" | 13 #include "base/files/file_util.h" |
14 #include "base/macros.h" | 14 #include "base/macros.h" |
15 #include "base/memory/weak_ptr.h" | 15 #include "base/memory/weak_ptr.h" |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
120 : base_path_(base_path), | 120 : base_path_(base_path), |
121 task_runner_(task_runner), | 121 task_runner_(task_runner), |
122 file_util_( | 122 file_util_( |
123 new storage::AsyncFileUtilAdapter(new TestFileUtil(base_path))), | 123 new storage::AsyncFileUtilAdapter(new TestFileUtil(base_path))), |
124 quota_util_(new QuotaUtil), | 124 quota_util_(new QuotaUtil), |
125 require_copy_or_move_validator_(false) { | 125 require_copy_or_move_validator_(false) { |
126 update_observers_ = | 126 update_observers_ = |
127 update_observers_.AddObserver(quota_util_.get(), task_runner_.get()); | 127 update_observers_.AddObserver(quota_util_.get(), task_runner_.get()); |
128 } | 128 } |
129 | 129 |
130 TestFileSystemBackend::~TestFileSystemBackend() { | 130 TestFileSystemBackend::~TestFileSystemBackend() {} |
131 } | |
132 | 131 |
133 bool TestFileSystemBackend::CanHandleType(storage::FileSystemType type) const { | 132 bool TestFileSystemBackend::CanHandleType(storage::FileSystemType type) const { |
134 return (type == storage::kFileSystemTypeTest); | 133 return (type == storage::kFileSystemTypeTest); |
135 } | 134 } |
136 | 135 |
137 void TestFileSystemBackend::Initialize(FileSystemContext* context) { | 136 void TestFileSystemBackend::Initialize(FileSystemContext* context) {} |
138 } | |
139 | 137 |
140 void TestFileSystemBackend::ResolveURL(const FileSystemURL& url, | 138 void TestFileSystemBackend::ResolveURL(const FileSystemURL& url, |
141 storage::OpenFileSystemMode mode, | 139 storage::OpenFileSystemMode mode, |
142 const OpenFileSystemCallback& callback) { | 140 const OpenFileSystemCallback& callback) { |
143 callback.Run(GetFileSystemRootURI(url.origin(), url.type()), | 141 callback.Run(GetFileSystemRootURI(url.origin(), url.type()), |
144 GetFileSystemName(url.origin(), url.type()), | 142 GetFileSystemName(url.origin(), url.type()), |
145 base::File::FILE_OK); | 143 base::File::FILE_OK); |
146 } | 144 } |
147 | 145 |
148 storage::AsyncFileUtil* TestFileSystemBackend::GetAsyncFileUtil( | 146 storage::AsyncFileUtil* TestFileSystemBackend::GetAsyncFileUtil( |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
238 return nullptr; | 236 return nullptr; |
239 } | 237 } |
240 | 238 |
241 void TestFileSystemBackend::AddFileChangeObserver( | 239 void TestFileSystemBackend::AddFileChangeObserver( |
242 storage::FileChangeObserver* observer) { | 240 storage::FileChangeObserver* observer) { |
243 change_observers_ = | 241 change_observers_ = |
244 change_observers_.AddObserver(observer, task_runner_.get()); | 242 change_observers_.AddObserver(observer, task_runner_.get()); |
245 } | 243 } |
246 | 244 |
247 } // namespace content | 245 } // namespace content |
OLD | NEW |