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 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
193 } | 193 } |
194 | 194 |
195 AsyncFileUtil* FileSystemContext::GetAsyncFileUtil( | 195 AsyncFileUtil* FileSystemContext::GetAsyncFileUtil( |
196 FileSystemType type) const { | 196 FileSystemType type) const { |
197 FileSystemBackend* backend = GetFileSystemBackend(type); | 197 FileSystemBackend* backend = GetFileSystemBackend(type); |
198 if (!backend) | 198 if (!backend) |
199 return NULL; | 199 return NULL; |
200 return backend->GetAsyncFileUtil(type); | 200 return backend->GetAsyncFileUtil(type); |
201 } | 201 } |
202 | 202 |
203 FileSystemFileUtil* FileSystemContext::GetFileUtil( | |
204 FileSystemType type) const { | |
205 FileSystemBackend* backend = GetFileSystemBackend(type); | |
206 if (!backend) | |
207 return NULL; | |
208 return backend->GetFileUtil(type); | |
209 } | |
210 | |
211 CopyOrMoveFileValidatorFactory* | 203 CopyOrMoveFileValidatorFactory* |
212 FileSystemContext::GetCopyOrMoveFileValidatorFactory( | 204 FileSystemContext::GetCopyOrMoveFileValidatorFactory( |
213 FileSystemType type, base::PlatformFileError* error_code) const { | 205 FileSystemType type, base::PlatformFileError* error_code) const { |
214 DCHECK(error_code); | 206 DCHECK(error_code); |
215 *error_code = base::PLATFORM_FILE_OK; | 207 *error_code = base::PLATFORM_FILE_OK; |
216 FileSystemBackend* backend = GetFileSystemBackend(type); | 208 FileSystemBackend* backend = GetFileSystemBackend(type); |
217 if (!backend) | 209 if (!backend) |
218 return NULL; | 210 return NULL; |
219 return backend->GetCopyOrMoveFileValidatorFactory( | 211 return backend->GetCopyOrMoveFileValidatorFactory( |
220 type, error_code); | 212 type, error_code); |
(...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
439 FileSystemType type = static_cast<FileSystemType>(t); | 431 FileSystemType type = static_cast<FileSystemType>(t); |
440 if (backend->CanHandleType(type)) { | 432 if (backend->CanHandleType(type)) { |
441 const bool inserted = backend_map_.insert( | 433 const bool inserted = backend_map_.insert( |
442 std::make_pair(type, backend)).second; | 434 std::make_pair(type, backend)).second; |
443 DCHECK(inserted); | 435 DCHECK(inserted); |
444 } | 436 } |
445 } | 437 } |
446 } | 438 } |
447 | 439 |
448 } // namespace fileapi | 440 } // namespace fileapi |
OLD | NEW |