| 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/sandbox_mount_point_provider.h" | 5 #include "webkit/fileapi/sandbox_mount_point_provider.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| 11 #include "base/metrics/histogram.h" | 11 #include "base/metrics/histogram.h" |
| 12 #include "base/rand_util.h" | 12 #include "base/rand_util.h" |
| 13 #include "base/sequenced_task_runner.h" | 13 #include "base/single_thread_task_runner.h" |
| 14 #include "base/string_util.h" | 14 #include "base/string_util.h" |
| 15 #include "base/stringprintf.h" | 15 #include "base/stringprintf.h" |
| 16 #include "base/task_runner_util.h" | 16 #include "base/task_runner_util.h" |
| 17 #include "googleurl/src/gurl.h" | 17 #include "googleurl/src/gurl.h" |
| 18 #include "net/base/net_util.h" | 18 #include "net/base/net_util.h" |
| 19 #include "webkit/fileapi/file_system_file_stream_reader.h" | 19 #include "webkit/fileapi/file_system_file_stream_reader.h" |
| 20 #include "webkit/fileapi/file_system_operation_context.h" | 20 #include "webkit/fileapi/file_system_operation_context.h" |
| 21 #include "webkit/fileapi/file_system_options.h" | 21 #include "webkit/fileapi/file_system_options.h" |
| 22 #include "webkit/fileapi/file_system_task_runners.h" |
| 22 #include "webkit/fileapi/file_system_types.h" | 23 #include "webkit/fileapi/file_system_types.h" |
| 23 #include "webkit/fileapi/file_system_usage_cache.h" | 24 #include "webkit/fileapi/file_system_usage_cache.h" |
| 24 #include "webkit/fileapi/file_system_util.h" | 25 #include "webkit/fileapi/file_system_util.h" |
| 25 #include "webkit/fileapi/local_file_system_operation.h" | 26 #include "webkit/fileapi/local_file_system_operation.h" |
| 26 #include "webkit/fileapi/native_file_util.h" | 27 #include "webkit/fileapi/native_file_util.h" |
| 27 #include "webkit/fileapi/obfuscated_file_util.h" | 28 #include "webkit/fileapi/obfuscated_file_util.h" |
| 28 #include "webkit/fileapi/sandbox_file_stream_writer.h" | 29 #include "webkit/fileapi/sandbox_file_stream_writer.h" |
| 29 #include "webkit/glue/webkit_glue.h" | 30 #include "webkit/glue/webkit_glue.h" |
| 30 #include "webkit/quota/quota_manager.h" | 31 #include "webkit/quota/quota_manager.h" |
| 31 | 32 |
| (...skipping 420 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 452 FileSystemQuotaUtil* SandboxMountPointProvider::GetQuotaUtil() { | 453 FileSystemQuotaUtil* SandboxMountPointProvider::GetQuotaUtil() { |
| 453 return this; | 454 return this; |
| 454 } | 455 } |
| 455 | 456 |
| 456 void SandboxMountPointProvider::DeleteFileSystem( | 457 void SandboxMountPointProvider::DeleteFileSystem( |
| 457 const GURL& origin_url, | 458 const GURL& origin_url, |
| 458 FileSystemType type, | 459 FileSystemType type, |
| 459 FileSystemContext* context, | 460 FileSystemContext* context, |
| 460 const DeleteFileSystemCallback& callback) { | 461 const DeleteFileSystemCallback& callback) { |
| 461 base::PostTaskAndReplyWithResult( | 462 base::PostTaskAndReplyWithResult( |
| 462 context->file_task_runner(), | 463 context->task_runners()->file_task_runner(), |
| 463 FROM_HERE, | 464 FROM_HERE, |
| 464 // It is safe to pass Unretained(this) since context owns it. | 465 // It is safe to pass Unretained(this) since context owns it. |
| 465 base::Bind(&SandboxMountPointProvider::DeleteOriginDataOnFileThread, | 466 base::Bind(&SandboxMountPointProvider::DeleteOriginDataOnFileThread, |
| 466 base::Unretained(this), | 467 base::Unretained(this), |
| 467 make_scoped_refptr(context), | 468 make_scoped_refptr(context), |
| 468 base::Unretained(context->quota_manager_proxy()), | 469 base::Unretained(context->quota_manager_proxy()), |
| 469 origin_url, | 470 origin_url, |
| 470 type), | 471 type), |
| 471 callback); | 472 callback); |
| 472 } | 473 } |
| (...skipping 276 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 749 break; | 750 break; |
| 750 case base::PLATFORM_FILE_ERROR_FAILED: | 751 case base::PLATFORM_FILE_ERROR_FAILED: |
| 751 default: | 752 default: |
| 752 REPORT(kUnknownError); | 753 REPORT(kUnknownError); |
| 753 break; | 754 break; |
| 754 } | 755 } |
| 755 #undef REPORT | 756 #undef REPORT |
| 756 } | 757 } |
| 757 | 758 |
| 758 } // namespace fileapi | 759 } // namespace fileapi |
| OLD | NEW |