| 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/isolated_file_system_backend.h" | 5 #include "webkit/browser/fileapi/isolated_file_system_backend.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
| 11 #include "base/files/file_util_proxy.h" | 11 #include "base/files/file_util_proxy.h" |
| 12 #include "base/logging.h" | 12 #include "base/logging.h" |
| 13 #include "base/message_loop/message_loop_proxy.h" | 13 #include "base/message_loop/message_loop_proxy.h" |
| 14 #include "base/sequenced_task_runner.h" | 14 #include "base/sequenced_task_runner.h" |
| 15 #include "webkit/browser/blob/file_stream_reader.h" | 15 #include "webkit/browser/blob/file_stream_reader.h" |
| 16 #include "webkit/browser/fileapi/async_file_util_adapter.h" | 16 #include "webkit/browser/fileapi/async_file_util_adapter.h" |
| 17 #include "webkit/browser/fileapi/copy_or_move_file_validator.h" | 17 #include "webkit/browser/fileapi/copy_or_move_file_validator.h" |
| 18 #include "webkit/browser/fileapi/dragged_file_util.h" | 18 #include "webkit/browser/fileapi/dragged_file_util.h" |
| 19 #include "webkit/browser/fileapi/file_stream_writer.h" | 19 #include "webkit/browser/fileapi/file_stream_writer.h" |
| 20 #include "webkit/browser/fileapi/file_system_context.h" | 20 #include "webkit/browser/fileapi/file_system_context.h" |
| 21 #include "webkit/browser/fileapi/file_system_operation.h" | 21 #include "webkit/browser/fileapi/file_system_operation.h" |
| 22 #include "webkit/browser/fileapi/file_system_operation_context.h" | 22 #include "webkit/browser/fileapi/file_system_operation_context.h" |
| 23 #include "webkit/browser/fileapi/isolated_context.h" | 23 #include "webkit/browser/fileapi/isolated_context.h" |
| 24 #include "webkit/browser/fileapi/native_file_util.h" | 24 #include "webkit/browser/fileapi/native_file_util.h" |
| 25 #include "webkit/browser/fileapi/transient_file_util.h" | 25 #include "webkit/browser/fileapi/transient_file_util.h" |
| 26 #include "webkit/browser/fileapi/watcher_manager.h" |
| 26 #include "webkit/common/fileapi/file_system_types.h" | 27 #include "webkit/common/fileapi/file_system_types.h" |
| 27 #include "webkit/common/fileapi/file_system_util.h" | 28 #include "webkit/common/fileapi/file_system_util.h" |
| 28 | 29 |
| 29 namespace fileapi { | 30 namespace fileapi { |
| 30 | 31 |
| 31 IsolatedFileSystemBackend::IsolatedFileSystemBackend() | 32 IsolatedFileSystemBackend::IsolatedFileSystemBackend() |
| 32 : isolated_file_util_(new AsyncFileUtilAdapter(new LocalFileUtil())), | 33 : isolated_file_util_(new AsyncFileUtilAdapter(new LocalFileUtil())), |
| 33 dragged_file_util_(new AsyncFileUtilAdapter(new DraggedFileUtil())), | 34 dragged_file_util_(new AsyncFileUtilAdapter(new DraggedFileUtil())), |
| 34 transient_file_util_(new AsyncFileUtilAdapter(new TransientFileUtil())) { | 35 transient_file_util_(new AsyncFileUtilAdapter(new TransientFileUtil())) { |
| 35 } | 36 } |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 77 case kFileSystemTypeDragged: | 78 case kFileSystemTypeDragged: |
| 78 return dragged_file_util_.get(); | 79 return dragged_file_util_.get(); |
| 79 case kFileSystemTypeForTransientFile: | 80 case kFileSystemTypeForTransientFile: |
| 80 return transient_file_util_.get(); | 81 return transient_file_util_.get(); |
| 81 default: | 82 default: |
| 82 NOTREACHED(); | 83 NOTREACHED(); |
| 83 } | 84 } |
| 84 return NULL; | 85 return NULL; |
| 85 } | 86 } |
| 86 | 87 |
| 88 WatcherManager* IsolatedFileSystemBackend::GetWatcherManager( |
| 89 FileSystemType type) { |
| 90 return NULL; |
| 91 } |
| 92 |
| 87 CopyOrMoveFileValidatorFactory* | 93 CopyOrMoveFileValidatorFactory* |
| 88 IsolatedFileSystemBackend::GetCopyOrMoveFileValidatorFactory( | 94 IsolatedFileSystemBackend::GetCopyOrMoveFileValidatorFactory( |
| 89 FileSystemType type, base::File::Error* error_code) { | 95 FileSystemType type, base::File::Error* error_code) { |
| 90 DCHECK(error_code); | 96 DCHECK(error_code); |
| 91 *error_code = base::File::FILE_OK; | 97 *error_code = base::File::FILE_OK; |
| 92 return NULL; | 98 return NULL; |
| 93 } | 99 } |
| 94 | 100 |
| 95 FileSystemOperation* IsolatedFileSystemBackend::CreateFileSystemOperation( | 101 FileSystemOperation* IsolatedFileSystemBackend::CreateFileSystemOperation( |
| 96 const FileSystemURL& url, | 102 const FileSystemURL& url, |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 128 offset, | 134 offset, |
| 129 FileStreamWriter::OPEN_EXISTING_FILE)); | 135 FileStreamWriter::OPEN_EXISTING_FILE)); |
| 130 } | 136 } |
| 131 | 137 |
| 132 FileSystemQuotaUtil* IsolatedFileSystemBackend::GetQuotaUtil() { | 138 FileSystemQuotaUtil* IsolatedFileSystemBackend::GetQuotaUtil() { |
| 133 // No quota support. | 139 // No quota support. |
| 134 return NULL; | 140 return NULL; |
| 135 } | 141 } |
| 136 | 142 |
| 137 } // namespace fileapi | 143 } // namespace fileapi |
| OLD | NEW |