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/isolated_mount_point_provider.h" | 5 #include "webkit/fileapi/isolated_mount_point_provider.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" |
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
174 } | 174 } |
175 | 175 |
176 #if defined(SUPPORT_MTP_DEVICE_FILESYSTEM) | 176 #if defined(SUPPORT_MTP_DEVICE_FILESYSTEM) |
177 if (url.type() == kFileSystemTypeDeviceMedia) | 177 if (url.type() == kFileSystemTypeDeviceMedia) |
178 operation_context->set_mtp_device_delegate_url(url.filesystem_id()); | 178 operation_context->set_mtp_device_delegate_url(url.filesystem_id()); |
179 #endif | 179 #endif |
180 | 180 |
181 return new LocalFileSystemOperation(context, operation_context.Pass()); | 181 return new LocalFileSystemOperation(context, operation_context.Pass()); |
182 } | 182 } |
183 | 183 |
184 webkit_blob::FileStreamReader* | 184 scoped_ptr<webkit_blob::FileStreamReader> |
185 IsolatedMountPointProvider::CreateFileStreamReader( | 185 IsolatedMountPointProvider::CreateFileStreamReader( |
186 const FileSystemURL& url, | 186 const FileSystemURL& url, |
187 int64 offset, | 187 int64 offset, |
188 const base::Time& expected_modification_time, | 188 const base::Time& expected_modification_time, |
189 FileSystemContext* context) const { | 189 FileSystemContext* context) const { |
190 return new webkit_blob::LocalFileStreamReader( | 190 return scoped_ptr<webkit_blob::FileStreamReader>( |
191 context->task_runners()->file_task_runner(), | 191 new webkit_blob::LocalFileStreamReader( |
192 url.path(), offset, expected_modification_time); | 192 context->task_runners()->file_task_runner(), |
| 193 url.path(), offset, expected_modification_time)); |
193 } | 194 } |
194 | 195 |
195 FileStreamWriter* IsolatedMountPointProvider::CreateFileStreamWriter( | 196 scoped_ptr<FileStreamWriter> IsolatedMountPointProvider::CreateFileStreamWriter( |
196 const FileSystemURL& url, | 197 const FileSystemURL& url, |
197 int64 offset, | 198 int64 offset, |
198 FileSystemContext* context) const { | 199 FileSystemContext* context) const { |
199 return new LocalFileStreamWriter(url.path(), offset); | 200 return scoped_ptr<FileStreamWriter>( |
| 201 new LocalFileStreamWriter(url.path(), offset)); |
200 } | 202 } |
201 | 203 |
202 FileSystemQuotaUtil* IsolatedMountPointProvider::GetQuotaUtil() { | 204 FileSystemQuotaUtil* IsolatedMountPointProvider::GetQuotaUtil() { |
203 // No quota support. | 205 // No quota support. |
204 return NULL; | 206 return NULL; |
205 } | 207 } |
206 | 208 |
207 void IsolatedMountPointProvider::DeleteFileSystem( | 209 void IsolatedMountPointProvider::DeleteFileSystem( |
208 const GURL& origin_url, | 210 const GURL& origin_url, |
209 FileSystemType type, | 211 FileSystemType type, |
210 FileSystemContext* context, | 212 FileSystemContext* context, |
211 const DeleteFileSystemCallback& callback) { | 213 const DeleteFileSystemCallback& callback) { |
212 NOTREACHED(); | 214 NOTREACHED(); |
213 callback.Run(base::PLATFORM_FILE_ERROR_INVALID_OPERATION); | 215 callback.Run(base::PLATFORM_FILE_ERROR_INVALID_OPERATION); |
214 } | 216 } |
215 | 217 |
216 } // namespace fileapi | 218 } // namespace fileapi |
OLD | NEW |