| 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/file_system_context.h" | 5 #include "webkit/browser/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" |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 #include "webkit/browser/fileapi/mount_points.h" | 24 #include "webkit/browser/fileapi/mount_points.h" |
| 25 #include "webkit/browser/fileapi/sandbox_mount_point_provider.h" | 25 #include "webkit/browser/fileapi/sandbox_mount_point_provider.h" |
| 26 #include "webkit/browser/fileapi/syncable/local_file_change_tracker.h" | 26 #include "webkit/browser/fileapi/syncable/local_file_change_tracker.h" |
| 27 #include "webkit/browser/fileapi/syncable/local_file_sync_context.h" | 27 #include "webkit/browser/fileapi/syncable/local_file_sync_context.h" |
| 28 #include "webkit/browser/fileapi/syncable/syncable_file_system_util.h" | 28 #include "webkit/browser/fileapi/syncable/syncable_file_system_util.h" |
| 29 #include "webkit/browser/fileapi/test_mount_point_provider.h" | 29 #include "webkit/browser/fileapi/test_mount_point_provider.h" |
| 30 #include "webkit/browser/quota/quota_manager.h" | 30 #include "webkit/browser/quota/quota_manager.h" |
| 31 #include "webkit/browser/quota/special_storage_policy.h" | 31 #include "webkit/browser/quota/special_storage_policy.h" |
| 32 #include "webkit/common/fileapi/file_system_util.h" | 32 #include "webkit/common/fileapi/file_system_util.h" |
| 33 | 33 |
| 34 #if defined(OS_CHROMEOS) | |
| 35 #include "webkit/browser/chromeos/fileapi/cros_mount_point_provider.h" | |
| 36 #endif | |
| 37 | |
| 38 using quota::QuotaClient; | 34 using quota::QuotaClient; |
| 39 | 35 |
| 40 namespace fileapi { | 36 namespace fileapi { |
| 41 | 37 |
| 42 namespace { | 38 namespace { |
| 43 | 39 |
| 44 QuotaClient* CreateQuotaClient( | 40 QuotaClient* CreateQuotaClient( |
| 45 FileSystemContext* context, | 41 FileSystemContext* context, |
| 46 bool is_incognito) { | 42 bool is_incognito) { |
| 47 return new FileSystemQuotaClient(context, is_incognito); | 43 return new FileSystemQuotaClient(context, is_incognito); |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 82 DCHECK(task_runners_.get()); | 78 DCHECK(task_runners_.get()); |
| 83 | 79 |
| 84 if (quota_manager_proxy) { | 80 if (quota_manager_proxy) { |
| 85 quota_manager_proxy->RegisterClient(CreateQuotaClient( | 81 quota_manager_proxy->RegisterClient(CreateQuotaClient( |
| 86 this, options.is_incognito())); | 82 this, options.is_incognito())); |
| 87 } | 83 } |
| 88 | 84 |
| 89 RegisterMountPointProvider(sandbox_provider_.get()); | 85 RegisterMountPointProvider(sandbox_provider_.get()); |
| 90 RegisterMountPointProvider(isolated_provider_.get()); | 86 RegisterMountPointProvider(isolated_provider_.get()); |
| 91 | 87 |
| 92 #if defined(OS_CHROMEOS) | |
| 93 // TODO(kinuko): Move this out of webkit/fileapi layer. | |
| 94 DCHECK(external_mount_points); | |
| 95 chromeos::CrosMountPointProvider* cros_mount_provider = | |
| 96 new chromeos::CrosMountPointProvider( | |
| 97 special_storage_policy, | |
| 98 external_mount_points, | |
| 99 ExternalMountPoints::GetSystemInstance()); | |
| 100 cros_mount_provider->AddSystemMountPoints(); | |
| 101 additional_providers_.push_back(cros_mount_provider); | |
| 102 DCHECK(cros_mount_provider->CanHandleType(kFileSystemTypeExternal)); | |
| 103 #endif | |
| 104 | |
| 105 for (ScopedVector<FileSystemMountPointProvider>::const_iterator iter = | 88 for (ScopedVector<FileSystemMountPointProvider>::const_iterator iter = |
| 106 additional_providers_.begin(); | 89 additional_providers_.begin(); |
| 107 iter != additional_providers_.end(); ++iter) { | 90 iter != additional_providers_.end(); ++iter) { |
| 108 RegisterMountPointProvider(*iter); | 91 RegisterMountPointProvider(*iter); |
| 109 } | 92 } |
| 110 | 93 |
| 111 // Additional mount points must be added before regular system-wide | 94 // Additional mount points must be added before regular system-wide |
| 112 // mount points. | 95 // mount points. |
| 113 if (external_mount_points) | 96 if (external_mount_points) |
| 114 url_crackers_.push_back(external_mount_points); | 97 url_crackers_.push_back(external_mount_points); |
| (...skipping 325 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 440 FileSystemType type = static_cast<FileSystemType>(t); | 423 FileSystemType type = static_cast<FileSystemType>(t); |
| 441 if (provider->CanHandleType(type)) { | 424 if (provider->CanHandleType(type)) { |
| 442 const bool inserted = provider_map_.insert( | 425 const bool inserted = provider_map_.insert( |
| 443 std::make_pair(type, provider)).second; | 426 std::make_pair(type, provider)).second; |
| 444 DCHECK(inserted); | 427 DCHECK(inserted); |
| 445 } | 428 } |
| 446 } | 429 } |
| 447 } | 430 } |
| 448 | 431 |
| 449 } // namespace fileapi | 432 } // namespace fileapi |
| OLD | NEW |