| 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 "base/task_runner_util.h" | 10 #include "base/task_runner_util.h" |
| (...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 114 partition_path, | 114 partition_path, |
| 115 special_storage_policy, | 115 special_storage_policy, |
| 116 options)), | 116 options)), |
| 117 sandbox_backend_(new SandboxFileSystemBackend( | 117 sandbox_backend_(new SandboxFileSystemBackend( |
| 118 sandbox_delegate_.get())), | 118 sandbox_delegate_.get())), |
| 119 isolated_backend_(new IsolatedFileSystemBackend()), | 119 isolated_backend_(new IsolatedFileSystemBackend()), |
| 120 additional_backends_(additional_backends.Pass()), | 120 additional_backends_(additional_backends.Pass()), |
| 121 external_mount_points_(external_mount_points), | 121 external_mount_points_(external_mount_points), |
| 122 partition_path_(partition_path), | 122 partition_path_(partition_path), |
| 123 operation_runner_(new FileSystemOperationRunner(this)) { | 123 operation_runner_(new FileSystemOperationRunner(this)) { |
| 124 if (quota_manager_proxy) { | |
| 125 quota_manager_proxy->RegisterClient(CreateQuotaClient( | |
| 126 this, options.is_incognito())); | |
| 127 } | |
| 128 | |
| 129 RegisterBackend(sandbox_backend_.get()); | 124 RegisterBackend(sandbox_backend_.get()); |
| 130 RegisterBackend(isolated_backend_.get()); | 125 RegisterBackend(isolated_backend_.get()); |
| 131 | 126 |
| 132 for (ScopedVector<FileSystemBackend>::const_iterator iter = | 127 for (ScopedVector<FileSystemBackend>::const_iterator iter = |
| 133 additional_backends_.begin(); | 128 additional_backends_.begin(); |
| 134 iter != additional_backends_.end(); ++iter) { | 129 iter != additional_backends_.end(); ++iter) { |
| 135 RegisterBackend(*iter); | 130 RegisterBackend(*iter); |
| 136 } | 131 } |
| 137 | 132 |
| 133 if (quota_manager_proxy) { |
| 134 // Quota client assumes all backends have registered. |
| 135 quota_manager_proxy->RegisterClient(CreateQuotaClient( |
| 136 this, options.is_incognito())); |
| 137 } |
| 138 |
| 138 sandbox_backend_->Initialize(this); | 139 sandbox_backend_->Initialize(this); |
| 139 isolated_backend_->Initialize(this); | 140 isolated_backend_->Initialize(this); |
| 140 for (ScopedVector<FileSystemBackend>::const_iterator iter = | 141 for (ScopedVector<FileSystemBackend>::const_iterator iter = |
| 141 additional_backends_.begin(); | 142 additional_backends_.begin(); |
| 142 iter != additional_backends_.end(); ++iter) { | 143 iter != additional_backends_.end(); ++iter) { |
| 143 (*iter)->Initialize(this); | 144 (*iter)->Initialize(this); |
| 144 } | 145 } |
| 145 | 146 |
| 146 // Additional mount points must be added before regular system-wide | 147 // Additional mount points must be added before regular system-wide |
| 147 // mount points. | 148 // mount points. |
| (...skipping 291 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 439 FileSystemType type = static_cast<FileSystemType>(t); | 440 FileSystemType type = static_cast<FileSystemType>(t); |
| 440 if (backend->CanHandleType(type)) { | 441 if (backend->CanHandleType(type)) { |
| 441 const bool inserted = backend_map_.insert( | 442 const bool inserted = backend_map_.insert( |
| 442 std::make_pair(type, backend)).second; | 443 std::make_pair(type, backend)).second; |
| 443 DCHECK(inserted); | 444 DCHECK(inserted); |
| 444 } | 445 } |
| 445 } | 446 } |
| 446 } | 447 } |
| 447 | 448 |
| 448 } // namespace fileapi | 449 } // namespace fileapi |
| OLD | NEW |