| 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/sequenced_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 "googleurl/src/gurl.h" | 16 #include "googleurl/src/gurl.h" |
| 17 #include "net/base/net_util.h" | 17 #include "net/base/net_util.h" |
| 18 #include "webkit/fileapi/file_system_file_reader.h" | 18 #include "webkit/fileapi/file_system_file_stream_reader.h" |
| 19 #include "webkit/fileapi/file_system_operation.h" | 19 #include "webkit/fileapi/file_system_operation.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_types.h" | 22 #include "webkit/fileapi/file_system_types.h" |
| 23 #include "webkit/fileapi/file_system_usage_cache.h" | 23 #include "webkit/fileapi/file_system_usage_cache.h" |
| 24 #include "webkit/fileapi/file_system_util.h" | 24 #include "webkit/fileapi/file_system_util.h" |
| 25 #include "webkit/fileapi/native_file_util.h" | 25 #include "webkit/fileapi/native_file_util.h" |
| 26 #include "webkit/fileapi/obfuscated_file_util.h" | 26 #include "webkit/fileapi/obfuscated_file_util.h" |
| 27 #include "webkit/glue/webkit_glue.h" | 27 #include "webkit/glue/webkit_glue.h" |
| 28 #include "webkit/quota/quota_manager.h" | 28 #include "webkit/quota/quota_manager.h" |
| (...skipping 413 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 442 | 442 |
| 443 FileSystemOperationInterface* | 443 FileSystemOperationInterface* |
| 444 SandboxMountPointProvider::CreateFileSystemOperation( | 444 SandboxMountPointProvider::CreateFileSystemOperation( |
| 445 const GURL& origin_url, | 445 const GURL& origin_url, |
| 446 FileSystemType file_system_type, | 446 FileSystemType file_system_type, |
| 447 const FilePath& virtual_path, | 447 const FilePath& virtual_path, |
| 448 FileSystemContext* context) const { | 448 FileSystemContext* context) const { |
| 449 return new FileSystemOperation(context); | 449 return new FileSystemOperation(context); |
| 450 } | 450 } |
| 451 | 451 |
| 452 webkit_blob::FileReader* SandboxMountPointProvider::CreateFileReader( | 452 webkit_blob::FileStreamReader* |
| 453 SandboxMountPointProvider::CreateFileStreamReader( |
| 453 const GURL& url, | 454 const GURL& url, |
| 454 int64 offset, | 455 int64 offset, |
| 455 FileSystemContext* context) const { | 456 FileSystemContext* context) const { |
| 456 return new FileSystemFileReader(context, url, offset); | 457 return new FileSystemFileStreamReader(context, url, offset); |
| 457 } | 458 } |
| 458 | 459 |
| 459 fileapi::FileWriter* SandboxMountPointProvider::CreateFileWriter( | 460 fileapi::FileWriter* SandboxMountPointProvider::CreateFileWriter( |
| 460 const GURL& url, | 461 const GURL& url, |
| 461 int64 offset, | 462 int64 offset, |
| 462 FileSystemContext* context) const { | 463 FileSystemContext* context) const { |
| 463 // TODO(kinaba,kinuko): return SandboxFileWriter when it is implemented. | 464 // TODO(kinaba,kinuko): return SandboxFileWriter when it is implemented. |
| 464 NOTIMPLEMENTED(); | 465 NOTIMPLEMENTED(); |
| 465 return NULL; | 466 return NULL; |
| 466 } | 467 } |
| (...skipping 272 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 739 break; | 740 break; |
| 740 case base::PLATFORM_FILE_ERROR_FAILED: | 741 case base::PLATFORM_FILE_ERROR_FAILED: |
| 741 default: | 742 default: |
| 742 REPORT(kUnknownError); | 743 REPORT(kUnknownError); |
| 743 break; | 744 break; |
| 744 } | 745 } |
| 745 #undef REPORT | 746 #undef REPORT |
| 746 } | 747 } |
| 747 | 748 |
| 748 } // namespace fileapi | 749 } // namespace fileapi |
| OLD | NEW |