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