| 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/file_util.h" | 8 #include "base/file_util.h" |
| 9 #include "base/stl_util.h" | 9 #include "base/stl_util.h" |
| 10 #include "base/single_thread_task_runner.h" | 10 #include "base/single_thread_task_runner.h" |
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 99 FileSystemQuotaUtil* | 99 FileSystemQuotaUtil* |
| 100 FileSystemContext::GetQuotaUtil(FileSystemType type) const { | 100 FileSystemContext::GetQuotaUtil(FileSystemType type) const { |
| 101 FileSystemMountPointProvider* mount_point_provider = | 101 FileSystemMountPointProvider* mount_point_provider = |
| 102 GetMountPointProvider(type); | 102 GetMountPointProvider(type); |
| 103 if (!mount_point_provider) | 103 if (!mount_point_provider) |
| 104 return NULL; | 104 return NULL; |
| 105 return mount_point_provider->GetQuotaUtil(); | 105 return mount_point_provider->GetQuotaUtil(); |
| 106 } | 106 } |
| 107 | 107 |
| 108 FileSystemFileUtil* FileSystemContext::GetFileUtil( | 108 FileSystemFileUtil* FileSystemContext::GetFileUtil( |
| 109 FileSystemType type) const { | 109 const FileSystemURL& url) const { |
| 110 FileSystemMountPointProvider* mount_point_provider = | 110 FileSystemMountPointProvider* mount_point_provider = |
| 111 GetMountPointProvider(type); | 111 GetMountPointProvider(url.type()); |
| 112 if (!mount_point_provider) | 112 if (!mount_point_provider) |
| 113 return NULL; | 113 return NULL; |
| 114 return mount_point_provider->GetFileUtil(); | 114 return mount_point_provider->GetFileUtil(url); |
| 115 } | 115 } |
| 116 | 116 |
| 117 FileSystemMountPointProvider* FileSystemContext::GetMountPointProvider( | 117 FileSystemMountPointProvider* FileSystemContext::GetMountPointProvider( |
| 118 FileSystemType type) const { | 118 FileSystemType type) const { |
| 119 switch (type) { | 119 switch (type) { |
| 120 case kFileSystemTypeTemporary: | 120 case kFileSystemTypeTemporary: |
| 121 case kFileSystemTypePersistent: | 121 case kFileSystemTypePersistent: |
| 122 return sandbox_provider_.get(); | 122 return sandbox_provider_.get(); |
| 123 case kFileSystemTypeExternal: | 123 case kFileSystemTypeExternal: |
| 124 return external_provider_.get(); | 124 return external_provider_.get(); |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 203 if (!io_task_runner_->RunsTasksOnCurrentThread() && | 203 if (!io_task_runner_->RunsTasksOnCurrentThread() && |
| 204 io_task_runner_->DeleteSoon(FROM_HERE, this)) { | 204 io_task_runner_->DeleteSoon(FROM_HERE, this)) { |
| 205 return; | 205 return; |
| 206 } | 206 } |
| 207 STLDeleteContainerPairSecondPointers(provider_map_.begin(), | 207 STLDeleteContainerPairSecondPointers(provider_map_.begin(), |
| 208 provider_map_.end()); | 208 provider_map_.end()); |
| 209 delete this; | 209 delete this; |
| 210 } | 210 } |
| 211 | 211 |
| 212 } // namespace fileapi | 212 } // namespace fileapi |
| OLD | NEW |