| 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 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 178 if (require_copy_or_move_validator_) { | 178 if (require_copy_or_move_validator_) { |
| 179 if (!copy_or_move_file_validator_factory_) | 179 if (!copy_or_move_file_validator_factory_) |
| 180 *error_code = base::PLATFORM_FILE_ERROR_SECURITY; | 180 *error_code = base::PLATFORM_FILE_ERROR_SECURITY; |
| 181 return copy_or_move_file_validator_factory_.get(); | 181 return copy_or_move_file_validator_factory_.get(); |
| 182 } | 182 } |
| 183 return NULL; | 183 return NULL; |
| 184 } | 184 } |
| 185 | 185 |
| 186 void TestFileSystemBackend::InitializeCopyOrMoveFileValidatorFactory( | 186 void TestFileSystemBackend::InitializeCopyOrMoveFileValidatorFactory( |
| 187 scoped_ptr<CopyOrMoveFileValidatorFactory> factory) { | 187 scoped_ptr<CopyOrMoveFileValidatorFactory> factory) { |
| 188 // What purpose is this check serving? | |
| 189 if (!require_copy_or_move_validator_) { | |
| 190 DCHECK(!factory); | |
| 191 return; | |
| 192 } | |
| 193 if (!copy_or_move_file_validator_factory_) | 188 if (!copy_or_move_file_validator_factory_) |
| 194 copy_or_move_file_validator_factory_ = factory.Pass(); | 189 copy_or_move_file_validator_factory_ = factory.Pass(); |
| 195 } | 190 } |
| 196 | 191 |
| 192 void TestFileSystemBackend::ResetCopyOrMoveFileValidatorFactory() { |
| 193 copy_or_move_file_validator_factory_.reset(); |
| 194 } |
| 195 |
| 197 FileSystemOperation* TestFileSystemBackend::CreateFileSystemOperation( | 196 FileSystemOperation* TestFileSystemBackend::CreateFileSystemOperation( |
| 198 const FileSystemURL& url, | 197 const FileSystemURL& url, |
| 199 FileSystemContext* context, | 198 FileSystemContext* context, |
| 200 base::PlatformFileError* error_code) const { | 199 base::PlatformFileError* error_code) const { |
| 201 scoped_ptr<FileSystemOperationContext> operation_context( | 200 scoped_ptr<FileSystemOperationContext> operation_context( |
| 202 new FileSystemOperationContext(context)); | 201 new FileSystemOperationContext(context)); |
| 203 operation_context->set_update_observers(*GetUpdateObservers(url.type())); | 202 operation_context->set_update_observers(*GetUpdateObservers(url.type())); |
| 204 operation_context->set_change_observers( | 203 operation_context->set_change_observers( |
| 205 *quota_util_->GetChangeObservers(url.type())); | 204 *quota_util_->GetChangeObservers(url.type())); |
| 206 operation_context->set_root_path(base_path_); | 205 operation_context->set_root_path(base_path_); |
| (...skipping 30 matching lines...) Expand all Loading... |
| 237 return quota_util_->GetUpdateObservers(type); | 236 return quota_util_->GetUpdateObservers(type); |
| 238 } | 237 } |
| 239 | 238 |
| 240 void TestFileSystemBackend::AddFileChangeObserver( | 239 void TestFileSystemBackend::AddFileChangeObserver( |
| 241 FileChangeObserver* observer) { | 240 FileChangeObserver* observer) { |
| 242 quota_util_->AddFileChangeObserver( | 241 quota_util_->AddFileChangeObserver( |
| 243 kFileSystemTypeTest, observer, quota_util_->task_runner()); | 242 kFileSystemTypeTest, observer, quota_util_->task_runner()); |
| 244 } | 243 } |
| 245 | 244 |
| 246 } // namespace fileapi | 245 } // namespace fileapi |
| OLD | NEW |