| 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/fileapi/file_system_context.h" | 5 #include "webkit/fileapi/file_system_context.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/single_thread_task_runner.h" | 8 #include "base/single_thread_task_runner.h" |
| 9 #include "base/stl_util.h" | 9 #include "base/stl_util.h" |
| 10 #include "googleurl/src/gurl.h" | 10 #include "googleurl/src/gurl.h" |
| 11 #include "webkit/blob/file_stream_reader.h" | 11 #include "webkit/blob/file_stream_reader.h" |
| 12 #include "webkit/fileapi/copy_or_move_file_validator.h" | 12 #include "webkit/fileapi/copy_or_move_file_validator.h" |
| 13 #include "webkit/fileapi/external_mount_points.h" | 13 #include "webkit/fileapi/external_mount_points.h" |
| 14 #include "webkit/fileapi/file_stream_writer.h" | 14 #include "webkit/fileapi/file_stream_writer.h" |
| 15 #include "webkit/fileapi/file_system_file_util.h" | 15 #include "webkit/fileapi/file_system_file_util.h" |
| 16 #include "webkit/fileapi/file_system_operation.h" | 16 #include "webkit/fileapi/file_system_operation.h" |
| 17 #include "webkit/fileapi/file_system_options.h" | 17 #include "webkit/fileapi/file_system_options.h" |
| 18 #include "webkit/fileapi/file_system_quota_client.h" | 18 #include "webkit/fileapi/file_system_quota_client.h" |
| 19 #include "webkit/fileapi/file_system_task_runners.h" | 19 #include "webkit/fileapi/file_system_task_runners.h" |
| 20 #include "webkit/fileapi/file_system_url.h" | 20 #include "webkit/fileapi/file_system_url.h" |
| 21 #include "webkit/fileapi/file_system_util.h" | 21 #include "webkit/fileapi/file_system_util.h" |
| 22 #include "webkit/fileapi/isolated_context.h" | 22 #include "webkit/fileapi/isolated_context.h" |
| 23 #include "webkit/fileapi/isolated_mount_point_provider.h" | 23 #include "webkit/fileapi/isolated_mount_point_provider.h" |
| 24 #include "webkit/fileapi/media/media_file_system_mount_point_provider.h" | |
| 25 #include "webkit/fileapi/mount_points.h" | 24 #include "webkit/fileapi/mount_points.h" |
| 26 #include "webkit/fileapi/sandbox_mount_point_provider.h" | 25 #include "webkit/fileapi/sandbox_mount_point_provider.h" |
| 27 #include "webkit/fileapi/syncable/local_file_change_tracker.h" | 26 #include "webkit/fileapi/syncable/local_file_change_tracker.h" |
| 28 #include "webkit/fileapi/syncable/local_file_sync_context.h" | 27 #include "webkit/fileapi/syncable/local_file_sync_context.h" |
| 29 #include "webkit/fileapi/syncable/syncable_file_system_util.h" | 28 #include "webkit/fileapi/syncable/syncable_file_system_util.h" |
| 30 #include "webkit/fileapi/test_mount_point_provider.h" | 29 #include "webkit/fileapi/test_mount_point_provider.h" |
| 31 #include "webkit/quota/quota_manager.h" | 30 #include "webkit/quota/quota_manager.h" |
| 32 #include "webkit/quota/special_storage_policy.h" | 31 #include "webkit/quota/special_storage_policy.h" |
| 33 | 32 |
| 34 #if defined(OS_CHROMEOS) | 33 #if defined(OS_CHROMEOS) |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 67 const FileSystemOptions& options) | 66 const FileSystemOptions& options) |
| 68 : task_runners_(task_runners.Pass()), | 67 : task_runners_(task_runners.Pass()), |
| 69 quota_manager_proxy_(quota_manager_proxy), | 68 quota_manager_proxy_(quota_manager_proxy), |
| 70 sandbox_provider_( | 69 sandbox_provider_( |
| 71 new SandboxMountPointProvider( | 70 new SandboxMountPointProvider( |
| 72 quota_manager_proxy, | 71 quota_manager_proxy, |
| 73 task_runners_->file_task_runner(), | 72 task_runners_->file_task_runner(), |
| 74 partition_path, | 73 partition_path, |
| 75 options)), | 74 options)), |
| 76 isolated_provider_(new IsolatedMountPointProvider()), | 75 isolated_provider_(new IsolatedMountPointProvider()), |
| 77 media_provider_(new MediaFileSystemMountPointProvider(partition_path)), | |
| 78 additional_providers_(additional_providers.Pass()), | 76 additional_providers_(additional_providers.Pass()), |
| 79 external_mount_points_(external_mount_points), | 77 external_mount_points_(external_mount_points), |
| 80 partition_path_(partition_path) { | 78 partition_path_(partition_path) { |
| 81 DCHECK(task_runners_.get()); | 79 DCHECK(task_runners_.get()); |
| 82 | 80 |
| 83 if (quota_manager_proxy) { | 81 if (quota_manager_proxy) { |
| 84 quota_manager_proxy->RegisterClient(CreateQuotaClient( | 82 quota_manager_proxy->RegisterClient(CreateQuotaClient( |
| 85 this, options.is_incognito())); | 83 this, options.is_incognito())); |
| 86 } | 84 } |
| 87 | 85 |
| 88 RegisterMountPointProvider(sandbox_provider_.get()); | 86 RegisterMountPointProvider(sandbox_provider_.get()); |
| 89 RegisterMountPointProvider(isolated_provider_.get()); | 87 RegisterMountPointProvider(isolated_provider_.get()); |
| 90 RegisterMountPointProvider(media_provider_.get()); | |
| 91 | 88 |
| 92 #if defined(OS_CHROMEOS) | 89 #if defined(OS_CHROMEOS) |
| 93 // TODO(kinuko): Move this out of webkit/fileapi layer. | 90 // TODO(kinuko): Move this out of webkit/fileapi layer. |
| 94 DCHECK(external_mount_points); | 91 DCHECK(external_mount_points); |
| 95 external_provider_.reset( | 92 external_provider_.reset( |
| 96 new chromeos::CrosMountPointProvider( | 93 new chromeos::CrosMountPointProvider( |
| 97 special_storage_policy, | 94 special_storage_policy, |
| 98 external_mount_points, | 95 external_mount_points, |
| 99 ExternalMountPoints::GetSystemInstance())); | 96 ExternalMountPoints::GetSystemInstance())); |
| 100 RegisterMountPointProvider(external_provider_.get()); | 97 RegisterMountPointProvider(external_provider_.get()); |
| (...skipping 313 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 414 FileSystemType type = static_cast<FileSystemType>(t); | 411 FileSystemType type = static_cast<FileSystemType>(t); |
| 415 if (provider->CanHandleType(type)) { | 412 if (provider->CanHandleType(type)) { |
| 416 const bool inserted = provider_map_.insert( | 413 const bool inserted = provider_map_.insert( |
| 417 std::make_pair(type, provider)).second; | 414 std::make_pair(type, provider)).second; |
| 418 DCHECK(inserted); | 415 DCHECK(inserted); |
| 419 } | 416 } |
| 420 } | 417 } |
| 421 } | 418 } |
| 422 | 419 |
| 423 } // namespace fileapi | 420 } // namespace fileapi |
| OLD | NEW |