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 #include "webkit/browser/fileapi/test_file_system_backend.h" | 5 #include "webkit/browser/fileapi/test_file_system_backend.h" |
6 | 6 |
7 #include <set> | 7 #include <set> |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
141 require_copy_or_move_validator_(false) { | 141 require_copy_or_move_validator_(false) { |
142 } | 142 } |
143 | 143 |
144 TestFileSystemBackend::~TestFileSystemBackend() { | 144 TestFileSystemBackend::~TestFileSystemBackend() { |
145 } | 145 } |
146 | 146 |
147 bool TestFileSystemBackend::CanHandleType(FileSystemType type) const { | 147 bool TestFileSystemBackend::CanHandleType(FileSystemType type) const { |
148 return (type == kFileSystemTypeTest); | 148 return (type == kFileSystemTypeTest); |
149 } | 149 } |
150 | 150 |
| 151 void TestFileSystemBackend::Initialize(const FileSystemContext* context) { |
| 152 } |
| 153 |
151 void TestFileSystemBackend::InitializeFileSystem( | 154 void TestFileSystemBackend::InitializeFileSystem( |
152 const GURL& origin_url, | 155 const GURL& origin_url, |
153 FileSystemType type, | 156 FileSystemType type, |
154 OpenFileSystemMode mode, | 157 OpenFileSystemMode mode, |
155 FileSystemContext* context, | 158 FileSystemContext* context, |
156 const InitializeFileSystemCallback& callback) { | 159 const InitializeFileSystemCallback& callback) { |
157 callback.Run(GetFileSystemRootURI(origin_url, type), | 160 callback.Run(GetFileSystemRootURI(origin_url, type), |
158 GetFileSystemName(origin_url, type), | 161 GetFileSystemName(origin_url, type), |
159 base::PLATFORM_FILE_OK); | 162 base::PLATFORM_FILE_OK); |
160 } | 163 } |
161 | 164 |
162 FileSystemFileUtil* TestFileSystemBackend::GetFileUtil(FileSystemType type) { | 165 FileSystemFileUtil* TestFileSystemBackend::GetFileUtil( |
| 166 FileSystemType type) { |
163 DCHECK(local_file_util_.get()); | 167 DCHECK(local_file_util_.get()); |
164 return local_file_util_->sync_file_util(); | 168 return local_file_util_->sync_file_util(); |
165 } | 169 } |
166 | 170 |
167 AsyncFileUtil* TestFileSystemBackend::GetAsyncFileUtil(FileSystemType type) { | 171 AsyncFileUtil* TestFileSystemBackend::GetAsyncFileUtil( |
| 172 FileSystemType type) { |
168 return local_file_util_.get(); | 173 return local_file_util_.get(); |
169 } | 174 } |
170 | 175 |
171 CopyOrMoveFileValidatorFactory* | 176 CopyOrMoveFileValidatorFactory* |
172 TestFileSystemBackend::GetCopyOrMoveFileValidatorFactory( | 177 TestFileSystemBackend::GetCopyOrMoveFileValidatorFactory( |
173 FileSystemType type, base::PlatformFileError* error_code) { | 178 FileSystemType type, base::PlatformFileError* error_code) { |
174 DCHECK(error_code); | 179 DCHECK(error_code); |
175 *error_code = base::PLATFORM_FILE_OK; | 180 *error_code = base::PLATFORM_FILE_OK; |
176 if (require_copy_or_move_validator_) { | 181 if (require_copy_or_move_validator_) { |
177 if (!copy_or_move_file_validator_factory_) | 182 if (!copy_or_move_file_validator_factory_) |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
234 return quota_util_->GetUpdateObservers(type); | 239 return quota_util_->GetUpdateObservers(type); |
235 } | 240 } |
236 | 241 |
237 void TestFileSystemBackend::AddFileChangeObserver( | 242 void TestFileSystemBackend::AddFileChangeObserver( |
238 FileChangeObserver* observer) { | 243 FileChangeObserver* observer) { |
239 quota_util_->AddFileChangeObserver( | 244 quota_util_->AddFileChangeObserver( |
240 kFileSystemTypeTest, observer, quota_util_->task_runner()); | 245 kFileSystemTypeTest, observer, quota_util_->task_runner()); |
241 } | 246 } |
242 | 247 |
243 } // namespace fileapi | 248 } // namespace fileapi |
OLD | NEW |