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_stream_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/fileapi/sandbox_file_stream_writer.h" |
27 #include "webkit/glue/webkit_glue.h" | 28 #include "webkit/glue/webkit_glue.h" |
28 #include "webkit/quota/quota_manager.h" | 29 #include "webkit/quota/quota_manager.h" |
29 | 30 |
30 using quota::QuotaManagerProxy; | 31 using quota::QuotaManagerProxy; |
31 | 32 |
32 namespace fileapi { | 33 namespace fileapi { |
33 | 34 |
34 namespace { | 35 namespace { |
35 | 36 |
36 const char kChromeScheme[] = "chrome"; | 37 const char kChromeScheme[] = "chrome"; |
(...skipping 417 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
454 const GURL& url, | 455 const GURL& url, |
455 int64 offset, | 456 int64 offset, |
456 FileSystemContext* context) const { | 457 FileSystemContext* context) const { |
457 return new FileSystemFileStreamReader(context, url, offset); | 458 return new FileSystemFileStreamReader(context, url, offset); |
458 } | 459 } |
459 | 460 |
460 fileapi::FileStreamWriter* SandboxMountPointProvider::CreateFileStreamWriter( | 461 fileapi::FileStreamWriter* SandboxMountPointProvider::CreateFileStreamWriter( |
461 const GURL& url, | 462 const GURL& url, |
462 int64 offset, | 463 int64 offset, |
463 FileSystemContext* context) const { | 464 FileSystemContext* context) const { |
464 // TODO(kinaba,kinuko): return SandboxFileWriter when it is implemented. | 465 return new SandboxFileStreamWriter(context, url, offset); |
465 NOTIMPLEMENTED(); | |
466 return NULL; | |
467 } | 466 } |
468 | 467 |
469 FileSystemQuotaUtil* SandboxMountPointProvider::GetQuotaUtil() { | 468 FileSystemQuotaUtil* SandboxMountPointProvider::GetQuotaUtil() { |
470 return this; | 469 return this; |
471 } | 470 } |
472 | 471 |
473 FilePath SandboxMountPointProvider::old_base_path() const { | 472 FilePath SandboxMountPointProvider::old_base_path() const { |
474 return profile_path_.Append(kOldFileSystemDirectory); | 473 return profile_path_.Append(kOldFileSystemDirectory); |
475 } | 474 } |
476 | 475 |
(...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
740 break; | 739 break; |
741 case base::PLATFORM_FILE_ERROR_FAILED: | 740 case base::PLATFORM_FILE_ERROR_FAILED: |
742 default: | 741 default: |
743 REPORT(kUnknownError); | 742 REPORT(kUnknownError); |
744 break; | 743 break; |
745 } | 744 } |
746 #undef REPORT | 745 #undef REPORT |
747 } | 746 } |
748 | 747 |
749 } // namespace fileapi | 748 } // namespace fileapi |
OLD | NEW |