| 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/platform_file.h" | 14 #include "base/platform_file.h" |
| 15 #include "base/sequenced_task_runner.h" | 15 #include "base/sequenced_task_runner.h" |
| 16 #include "webkit/browser/blob/local_file_stream_reader.h" | 16 #include "webkit/browser/blob/local_file_stream_reader.h" |
| 17 #include "webkit/browser/fileapi/async_file_util_adapter.h" | 17 #include "webkit/browser/fileapi/async_file_util_adapter.h" |
| 18 #include "webkit/browser/fileapi/copy_or_move_file_validator.h" | 18 #include "webkit/browser/fileapi/copy_or_move_file_validator.h" |
| 19 #include "webkit/browser/fileapi/file_system_context.h" | 19 #include "webkit/browser/fileapi/file_system_context.h" |
| 20 #include "webkit/browser/fileapi/file_system_file_stream_reader.h" | 20 #include "webkit/browser/fileapi/file_system_file_stream_reader.h" |
| 21 #include "webkit/browser/fileapi/file_system_operation_context.h" | 21 #include "webkit/browser/fileapi/file_system_operation_context.h" |
| 22 #include "webkit/browser/fileapi/file_system_operation_impl.h" | 22 #include "webkit/browser/fileapi/file_system_operation_impl.h" |
| 23 #include "webkit/browser/fileapi/file_system_task_runners.h" | |
| 24 #include "webkit/browser/fileapi/isolated_context.h" | 23 #include "webkit/browser/fileapi/isolated_context.h" |
| 25 #include "webkit/browser/fileapi/isolated_file_util.h" | 24 #include "webkit/browser/fileapi/isolated_file_util.h" |
| 26 #include "webkit/browser/fileapi/local_file_stream_writer.h" | 25 #include "webkit/browser/fileapi/local_file_stream_writer.h" |
| 27 #include "webkit/browser/fileapi/native_file_util.h" | 26 #include "webkit/browser/fileapi/native_file_util.h" |
| 28 #include "webkit/browser/fileapi/transient_file_util.h" | 27 #include "webkit/browser/fileapi/transient_file_util.h" |
| 29 #include "webkit/common/fileapi/file_system_types.h" | 28 #include "webkit/common/fileapi/file_system_types.h" |
| 30 #include "webkit/common/fileapi/file_system_util.h" | 29 #include "webkit/common/fileapi/file_system_util.h" |
| 31 | 30 |
| 32 namespace fileapi { | 31 namespace fileapi { |
| 33 | 32 |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 120 } | 119 } |
| 121 | 120 |
| 122 scoped_ptr<webkit_blob::FileStreamReader> | 121 scoped_ptr<webkit_blob::FileStreamReader> |
| 123 IsolatedFileSystemBackend::CreateFileStreamReader( | 122 IsolatedFileSystemBackend::CreateFileStreamReader( |
| 124 const FileSystemURL& url, | 123 const FileSystemURL& url, |
| 125 int64 offset, | 124 int64 offset, |
| 126 const base::Time& expected_modification_time, | 125 const base::Time& expected_modification_time, |
| 127 FileSystemContext* context) const { | 126 FileSystemContext* context) const { |
| 128 return scoped_ptr<webkit_blob::FileStreamReader>( | 127 return scoped_ptr<webkit_blob::FileStreamReader>( |
| 129 new webkit_blob::LocalFileStreamReader( | 128 new webkit_blob::LocalFileStreamReader( |
| 130 context->task_runners()->file_task_runner(), | 129 context->default_file_task_runner(), |
| 131 url.path(), offset, expected_modification_time)); | 130 url.path(), offset, expected_modification_time)); |
| 132 } | 131 } |
| 133 | 132 |
| 134 scoped_ptr<FileStreamWriter> IsolatedFileSystemBackend::CreateFileStreamWriter( | 133 scoped_ptr<FileStreamWriter> IsolatedFileSystemBackend::CreateFileStreamWriter( |
| 135 const FileSystemURL& url, | 134 const FileSystemURL& url, |
| 136 int64 offset, | 135 int64 offset, |
| 137 FileSystemContext* context) const { | 136 FileSystemContext* context) const { |
| 138 return scoped_ptr<FileStreamWriter>(new LocalFileStreamWriter( | 137 return scoped_ptr<FileStreamWriter>(new LocalFileStreamWriter( |
| 139 context->task_runners()->file_task_runner(), url.path(), offset)); | 138 context->default_file_task_runner(), url.path(), offset)); |
| 140 } | 139 } |
| 141 | 140 |
| 142 FileSystemQuotaUtil* IsolatedFileSystemBackend::GetQuotaUtil() { | 141 FileSystemQuotaUtil* IsolatedFileSystemBackend::GetQuotaUtil() { |
| 143 // No quota support. | 142 // No quota support. |
| 144 return NULL; | 143 return NULL; |
| 145 } | 144 } |
| 146 | 145 |
| 147 } // namespace fileapi | 146 } // namespace fileapi |
| OLD | NEW |