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 251 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
262 OpenFileSystemMode mode, | 262 OpenFileSystemMode mode, |
263 const OpenFileSystemCallback& callback) { | 263 const OpenFileSystemCallback& callback) { |
264 DCHECK(!callback.is_null()); | 264 DCHECK(!callback.is_null()); |
265 | 265 |
266 FileSystemBackend* backend = GetFileSystemBackend(type); | 266 FileSystemBackend* backend = GetFileSystemBackend(type); |
267 if (!backend) { | 267 if (!backend) { |
268 callback.Run(base::PLATFORM_FILE_ERROR_SECURITY, std::string(), GURL()); | 268 callback.Run(base::PLATFORM_FILE_ERROR_SECURITY, std::string(), GURL()); |
269 return; | 269 return; |
270 } | 270 } |
271 | 271 |
272 backend->OpenFileSystem(origin_url, type, mode, | 272 backend->InitializeFileSystem(origin_url, type, mode, this, |
273 base::Bind(&DidOpenFileSystem, callback)); | 273 base::Bind(&DidOpenFileSystem, callback)); |
274 } | 274 } |
275 | 275 |
276 void FileSystemContext::DeleteFileSystem( | 276 void FileSystemContext::DeleteFileSystem( |
277 const GURL& origin_url, | 277 const GURL& origin_url, |
278 FileSystemType type, | 278 FileSystemType type, |
279 const DeleteFileSystemCallback& callback) { | 279 const DeleteFileSystemCallback& callback) { |
280 DCHECK(origin_url == origin_url.GetOrigin()); | 280 DCHECK(origin_url == origin_url.GetOrigin()); |
281 FileSystemBackend* backend = GetFileSystemBackend(type); | 281 FileSystemBackend* backend = GetFileSystemBackend(type); |
282 if (!backend) { | 282 if (!backend) { |
283 callback.Run(base::PLATFORM_FILE_ERROR_SECURITY); | 283 callback.Run(base::PLATFORM_FILE_ERROR_SECURITY); |
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
450 FileSystemType type = static_cast<FileSystemType>(t); | 450 FileSystemType type = static_cast<FileSystemType>(t); |
451 if (backend->CanHandleType(type)) { | 451 if (backend->CanHandleType(type)) { |
452 const bool inserted = backend_map_.insert( | 452 const bool inserted = backend_map_.insert( |
453 std::make_pair(type, backend)).second; | 453 std::make_pair(type, backend)).second; |
454 DCHECK(inserted); | 454 DCHECK(inserted); |
455 } | 455 } |
456 } | 456 } |
457 } | 457 } |
458 | 458 |
459 } // namespace fileapi | 459 } // namespace fileapi |
OLD | NEW |