| 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 "webkit/browser/fileapi/syncable/canned_syncable_file_system.h" | 5 #include "webkit/browser/fileapi/syncable/canned_syncable_file_system.h" |
| 6 | 6 |
| 7 #include <iterator> | 7 #include <iterator> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
| 11 #include "base/file_util.h" | 11 #include "base/file_util.h" |
| 12 #include "base/message_loop/message_loop_proxy.h" | 12 #include "base/message_loop/message_loop_proxy.h" |
| 13 #include "base/run_loop.h" | 13 #include "base/run_loop.h" |
| 14 #include "base/single_thread_task_runner.h" | 14 #include "base/single_thread_task_runner.h" |
| 15 #include "base/task_runner_util.h" | 15 #include "base/task_runner_util.h" |
| 16 #include "testing/gtest/include/gtest/gtest.h" | 16 #include "testing/gtest/include/gtest/gtest.h" |
| 17 #include "webkit/browser/blob/mock_blob_url_request_context.h" | 17 #include "webkit/browser/blob/mock_blob_url_request_context.h" |
| 18 #include "webkit/browser/fileapi/external_mount_points.h" | 18 #include "webkit/browser/fileapi/external_mount_points.h" |
| 19 #include "webkit/browser/fileapi/file_system_backend.h" | 19 #include "webkit/browser/fileapi/file_system_backend.h" |
| 20 #include "webkit/browser/fileapi/file_system_context.h" | 20 #include "webkit/browser/fileapi/file_system_context.h" |
| 21 #include "webkit/browser/fileapi/file_system_operation_context.h" | 21 #include "webkit/browser/fileapi/file_system_operation_context.h" |
| 22 #include "webkit/browser/fileapi/file_system_operation_runner.h" | 22 #include "webkit/browser/fileapi/file_system_operation_runner.h" |
| 23 #include "webkit/browser/fileapi/file_system_task_runners.h" | |
| 24 #include "webkit/browser/fileapi/mock_file_system_options.h" | 23 #include "webkit/browser/fileapi/mock_file_system_options.h" |
| 25 #include "webkit/browser/fileapi/sandbox_file_system_backend.h" | 24 #include "webkit/browser/fileapi/sandbox_file_system_backend.h" |
| 26 #include "webkit/browser/fileapi/syncable/local_file_change_tracker.h" | 25 #include "webkit/browser/fileapi/syncable/local_file_change_tracker.h" |
| 27 #include "webkit/browser/fileapi/syncable/local_file_sync_context.h" | 26 #include "webkit/browser/fileapi/syncable/local_file_sync_context.h" |
| 28 #include "webkit/browser/fileapi/syncable/sync_file_system_backend.h" | 27 #include "webkit/browser/fileapi/syncable/sync_file_system_backend.h" |
| 29 #include "webkit/browser/fileapi/syncable/syncable_file_system_util.h" | 28 #include "webkit/browser/fileapi/syncable/syncable_file_system_util.h" |
| 30 #include "webkit/browser/quota/mock_special_storage_policy.h" | 29 #include "webkit/browser/quota/mock_special_storage_policy.h" |
| 31 #include "webkit/browser/quota/quota_manager.h" | 30 #include "webkit/browser/quota/quota_manager.h" |
| 32 #include "webkit/common/blob/shareable_file_reference.h" | 31 #include "webkit/common/blob/shareable_file_reference.h" |
| 33 | 32 |
| (...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 230 std::vector<std::string> additional_allowed_schemes; | 229 std::vector<std::string> additional_allowed_schemes; |
| 231 additional_allowed_schemes.push_back(origin_.scheme()); | 230 additional_allowed_schemes.push_back(origin_.scheme()); |
| 232 fileapi::FileSystemOptions options( | 231 fileapi::FileSystemOptions options( |
| 233 fileapi::FileSystemOptions::PROFILE_MODE_NORMAL, | 232 fileapi::FileSystemOptions::PROFILE_MODE_NORMAL, |
| 234 additional_allowed_schemes); | 233 additional_allowed_schemes); |
| 235 | 234 |
| 236 ScopedVector<fileapi::FileSystemBackend> additional_backends; | 235 ScopedVector<fileapi::FileSystemBackend> additional_backends; |
| 237 additional_backends.push_back(new SyncFileSystemBackend()); | 236 additional_backends.push_back(new SyncFileSystemBackend()); |
| 238 | 237 |
| 239 file_system_context_ = new FileSystemContext( | 238 file_system_context_ = new FileSystemContext( |
| 240 make_scoped_ptr( | 239 io_task_runner_.get(), |
| 241 new fileapi::FileSystemTaskRunners(io_task_runner_.get(), | 240 file_task_runner_.get(), |
| 242 file_task_runner_.get())), | |
| 243 fileapi::ExternalMountPoints::CreateRefCounted().get(), | 241 fileapi::ExternalMountPoints::CreateRefCounted().get(), |
| 244 storage_policy.get(), | 242 storage_policy.get(), |
| 245 quota_manager_->proxy(), | 243 quota_manager_->proxy(), |
| 246 additional_backends.Pass(), | 244 additional_backends.Pass(), |
| 247 data_dir_.path(), options); | 245 data_dir_.path(), options); |
| 248 | 246 |
| 249 is_filesystem_set_up_ = true; | 247 is_filesystem_set_up_ = true; |
| 250 } | 248 } |
| 251 | 249 |
| 252 void CannedSyncableFileSystem::TearDown() { | 250 void CannedSyncableFileSystem::TearDown() { |
| (...skipping 418 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 671 sync_status_ = status; | 669 sync_status_ = status; |
| 672 base::MessageLoop::current()->Quit(); | 670 base::MessageLoop::current()->Quit(); |
| 673 } | 671 } |
| 674 | 672 |
| 675 void CannedSyncableFileSystem::InitializeSyncStatusObserver() { | 673 void CannedSyncableFileSystem::InitializeSyncStatusObserver() { |
| 676 ASSERT_TRUE(io_task_runner_->RunsTasksOnCurrentThread()); | 674 ASSERT_TRUE(io_task_runner_->RunsTasksOnCurrentThread()); |
| 677 backend()->sync_context()->sync_status()->AddObserver(this); | 675 backend()->sync_context()->sync_status()->AddObserver(this); |
| 678 } | 676 } |
| 679 | 677 |
| 680 } // namespace sync_file_system | 678 } // namespace sync_file_system |
| OLD | NEW |