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.h" |
16 #include "webkit/browser/fileapi/file_system_operation_context.h" | 17 #include "webkit/browser/fileapi/file_system_operation_context.h" |
17 #include "webkit/browser/fileapi/file_system_operation_impl.h" | |
18 #include "webkit/browser/fileapi/file_system_quota_util.h" | 18 #include "webkit/browser/fileapi/file_system_quota_util.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. |
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
176 FileSystemOperation* TestFileSystemBackend::CreateFileSystemOperation( | 176 FileSystemOperation* TestFileSystemBackend::CreateFileSystemOperation( |
177 const FileSystemURL& url, | 177 const FileSystemURL& url, |
178 FileSystemContext* context, | 178 FileSystemContext* context, |
179 base::PlatformFileError* error_code) const { | 179 base::PlatformFileError* error_code) const { |
180 scoped_ptr<FileSystemOperationContext> operation_context( | 180 scoped_ptr<FileSystemOperationContext> operation_context( |
181 new FileSystemOperationContext(context)); | 181 new FileSystemOperationContext(context)); |
182 operation_context->set_update_observers(*GetUpdateObservers(url.type())); | 182 operation_context->set_update_observers(*GetUpdateObservers(url.type())); |
183 operation_context->set_change_observers( | 183 operation_context->set_change_observers( |
184 *quota_util_->GetChangeObservers(url.type())); | 184 *quota_util_->GetChangeObservers(url.type())); |
185 operation_context->set_root_path(base_path_); | 185 operation_context->set_root_path(base_path_); |
186 return new FileSystemOperationImpl(url, context, operation_context.Pass()); | 186 return FileSystemOperation::Create(url, context, operation_context.Pass()); |
187 } | 187 } |
188 | 188 |
189 scoped_ptr<webkit_blob::FileStreamReader> | 189 scoped_ptr<webkit_blob::FileStreamReader> |
190 TestFileSystemBackend::CreateFileStreamReader( | 190 TestFileSystemBackend::CreateFileStreamReader( |
191 const FileSystemURL& url, | 191 const FileSystemURL& url, |
192 int64 offset, | 192 int64 offset, |
193 const base::Time& expected_modification_time, | 193 const base::Time& expected_modification_time, |
194 FileSystemContext* context) const { | 194 FileSystemContext* context) const { |
195 return scoped_ptr<webkit_blob::FileStreamReader>( | 195 return scoped_ptr<webkit_blob::FileStreamReader>( |
196 new FileSystemFileStreamReader( | 196 new FileSystemFileStreamReader( |
(...skipping 19 matching lines...) Expand all Loading... |
216 return quota_util_->GetUpdateObservers(type); | 216 return quota_util_->GetUpdateObservers(type); |
217 } | 217 } |
218 | 218 |
219 void TestFileSystemBackend::AddFileChangeObserver( | 219 void TestFileSystemBackend::AddFileChangeObserver( |
220 FileChangeObserver* observer) { | 220 FileChangeObserver* observer) { |
221 quota_util_->AddFileChangeObserver( | 221 quota_util_->AddFileChangeObserver( |
222 kFileSystemTypeTest, observer, quota_util_->task_runner()); | 222 kFileSystemTypeTest, observer, quota_util_->task_runner()); |
223 } | 223 } |
224 | 224 |
225 } // namespace fileapi | 225 } // namespace fileapi |
OLD | NEW |