| 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 |
| 11 #include "base/file_util.h" | 11 #include "base/file_util.h" |
| 12 #include "base/sequenced_task_runner.h" | 12 #include "base/sequenced_task_runner.h" |
| 13 #include "webkit/browser/fileapi/copy_or_move_file_validator.h" | 13 #include "webkit/browser/fileapi/copy_or_move_file_validator.h" |
| 14 #include "webkit/browser/fileapi/file_observers.h" | 14 #include "webkit/browser/fileapi/file_observers.h" |
| 15 #include "webkit/browser/fileapi/file_system_file_stream_reader.h" | 15 #include "webkit/browser/fileapi/file_system_file_stream_reader.h" |
| 16 #include "webkit/browser/fileapi/file_system_operation_context.h" | 16 #include "webkit/browser/fileapi/file_system_operation_context.h" |
| 17 #include "webkit/browser/fileapi/file_system_operation_impl.h" |
| 17 #include "webkit/browser/fileapi/file_system_quota_util.h" | 18 #include "webkit/browser/fileapi/file_system_quota_util.h" |
| 18 #include "webkit/browser/fileapi/local_file_system_operation.h" | |
| 19 #include "webkit/browser/fileapi/local_file_util.h" | 19 #include "webkit/browser/fileapi/local_file_util.h" |
| 20 #include "webkit/browser/fileapi/native_file_util.h" | 20 #include "webkit/browser/fileapi/native_file_util.h" |
| 21 #include "webkit/browser/fileapi/sandbox_file_stream_writer.h" | 21 #include "webkit/browser/fileapi/sandbox_file_stream_writer.h" |
| 22 #include "webkit/browser/quota/quota_manager.h" | 22 #include "webkit/browser/quota/quota_manager.h" |
| 23 #include "webkit/common/fileapi/file_system_util.h" | 23 #include "webkit/common/fileapi/file_system_util.h" |
| 24 | 24 |
| 25 namespace fileapi { | 25 namespace fileapi { |
| 26 | 26 |
| 27 // This only supports single origin. | 27 // This only supports single origin. |
| 28 class TestFileSystemBackend::QuotaUtil | 28 class TestFileSystemBackend::QuotaUtil |
| (...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 197 FileSystemOperation* TestFileSystemBackend::CreateFileSystemOperation( | 197 FileSystemOperation* TestFileSystemBackend::CreateFileSystemOperation( |
| 198 const FileSystemURL& url, | 198 const FileSystemURL& url, |
| 199 FileSystemContext* context, | 199 FileSystemContext* context, |
| 200 base::PlatformFileError* error_code) const { | 200 base::PlatformFileError* error_code) const { |
| 201 scoped_ptr<FileSystemOperationContext> operation_context( | 201 scoped_ptr<FileSystemOperationContext> operation_context( |
| 202 new FileSystemOperationContext(context)); | 202 new FileSystemOperationContext(context)); |
| 203 operation_context->set_update_observers(*GetUpdateObservers(url.type())); | 203 operation_context->set_update_observers(*GetUpdateObservers(url.type())); |
| 204 operation_context->set_change_observers( | 204 operation_context->set_change_observers( |
| 205 *quota_util_->GetChangeObservers(url.type())); | 205 *quota_util_->GetChangeObservers(url.type())); |
| 206 operation_context->set_root_path(base_path_); | 206 operation_context->set_root_path(base_path_); |
| 207 return new LocalFileSystemOperation(url, context, operation_context.Pass()); | 207 return new FileSystemOperationImpl(url, context, operation_context.Pass()); |
| 208 } | 208 } |
| 209 | 209 |
| 210 scoped_ptr<webkit_blob::FileStreamReader> | 210 scoped_ptr<webkit_blob::FileStreamReader> |
| 211 TestFileSystemBackend::CreateFileStreamReader( | 211 TestFileSystemBackend::CreateFileStreamReader( |
| 212 const FileSystemURL& url, | 212 const FileSystemURL& url, |
| 213 int64 offset, | 213 int64 offset, |
| 214 const base::Time& expected_modification_time, | 214 const base::Time& expected_modification_time, |
| 215 FileSystemContext* context) const { | 215 FileSystemContext* context) const { |
| 216 return scoped_ptr<webkit_blob::FileStreamReader>( | 216 return scoped_ptr<webkit_blob::FileStreamReader>( |
| 217 new FileSystemFileStreamReader( | 217 new FileSystemFileStreamReader( |
| (...skipping 19 matching lines...) Expand all Loading... |
| 237 return quota_util_->GetUpdateObservers(type); | 237 return quota_util_->GetUpdateObservers(type); |
| 238 } | 238 } |
| 239 | 239 |
| 240 void TestFileSystemBackend::AddFileChangeObserver( | 240 void TestFileSystemBackend::AddFileChangeObserver( |
| 241 FileChangeObserver* observer) { | 241 FileChangeObserver* observer) { |
| 242 quota_util_->AddFileChangeObserver( | 242 quota_util_->AddFileChangeObserver( |
| 243 kFileSystemTypeTest, observer, quota_util_->task_runner()); | 243 kFileSystemTypeTest, observer, quota_util_->task_runner()); |
| 244 } | 244 } |
| 245 | 245 |
| 246 } // namespace fileapi | 246 } // namespace fileapi |
| OLD | NEW |