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/chromeos/fileapi/cros_mount_point_provider.h" | 5 #include "webkit/chromeos/fileapi/cros_mount_point_provider.h" |
6 | 6 |
7 #include "base/chromeos/chromeos_version.h" | 7 #include "base/chromeos/chromeos_version.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "base/message_loop.h" | 10 #include "base/message_loop.h" |
(...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
263 url.type() == fileapi::kFileSystemTypeRestrictedNativeLocal); | 263 url.type() == fileapi::kFileSystemTypeRestrictedNativeLocal); |
264 scoped_ptr<fileapi::FileSystemOperationContext> operation_context( | 264 scoped_ptr<fileapi::FileSystemOperationContext> operation_context( |
265 new fileapi::FileSystemOperationContext(context)); | 265 new fileapi::FileSystemOperationContext(context)); |
266 return new fileapi::LocalFileSystemOperation(context, | 266 return new fileapi::LocalFileSystemOperation(context, |
267 operation_context.Pass()); | 267 operation_context.Pass()); |
268 } | 268 } |
269 | 269 |
270 webkit_blob::FileStreamReader* CrosMountPointProvider::CreateFileStreamReader( | 270 webkit_blob::FileStreamReader* CrosMountPointProvider::CreateFileStreamReader( |
271 const fileapi::FileSystemURL& url, | 271 const fileapi::FileSystemURL& url, |
272 int64 offset, | 272 int64 offset, |
| 273 const base::Time& expected_modification_time, |
273 fileapi::FileSystemContext* context) const { | 274 fileapi::FileSystemContext* context) const { |
274 // For now we return a generic Reader implementation which utilizes | 275 // For now we return a generic Reader implementation which utilizes |
275 // CreateSnapshotFile internally (i.e. will download everything first). | 276 // CreateSnapshotFile internally (i.e. will download everything first). |
276 // TODO(satorux,zel): implement more efficient reader for remote cases. | 277 // TODO(satorux,zel): implement more efficient reader for remote cases. |
277 return new fileapi::FileSystemFileStreamReader(context, url, offset); | 278 return new fileapi::FileSystemFileStreamReader( |
| 279 context, url, offset, expected_modification_time); |
278 } | 280 } |
279 | 281 |
280 fileapi::FileStreamWriter* CrosMountPointProvider::CreateFileStreamWriter( | 282 fileapi::FileStreamWriter* CrosMountPointProvider::CreateFileStreamWriter( |
281 const fileapi::FileSystemURL& url, | 283 const fileapi::FileSystemURL& url, |
282 int64 offset, | 284 int64 offset, |
283 fileapi::FileSystemContext* context) const { | 285 fileapi::FileSystemContext* context) const { |
284 if (!url.is_valid()) | 286 if (!url.is_valid()) |
285 return NULL; | 287 return NULL; |
286 if (url.type() == fileapi::kFileSystemTypeDrive) { | 288 if (url.type() == fileapi::kFileSystemTypeDrive) { |
287 base::AutoLock locker(mount_point_map_lock_); | 289 base::AutoLock locker(mount_point_map_lock_); |
(...skipping 24 matching lines...) Expand all Loading... |
312 } | 314 } |
313 return iter->first.DirName().AppendRelativePath( | 315 return iter->first.DirName().AppendRelativePath( |
314 filesystem_path, virtual_path); | 316 filesystem_path, virtual_path); |
315 } | 317 } |
316 | 318 |
317 fileapi::IsolatedContext* CrosMountPointProvider::isolated_context() const { | 319 fileapi::IsolatedContext* CrosMountPointProvider::isolated_context() const { |
318 return fileapi::IsolatedContext::GetInstance(); | 320 return fileapi::IsolatedContext::GetInstance(); |
319 } | 321 } |
320 | 322 |
321 } // namespace chromeos | 323 } // namespace chromeos |
OLD | NEW |