OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "chrome/browser/chromeos/fileapi/mtp_file_system_backend_delegate.h" | 5 #include "chrome/browser/chromeos/fileapi/mtp_file_system_backend_delegate.h" |
6 #include "chrome/browser/media_galleries/fileapi/device_media_async_file_util.h" | 6 #include "chrome/browser/media_galleries/fileapi/device_media_async_file_util.h" |
7 #include "storage/browser/fileapi/file_stream_reader.h" | 7 #include "storage/browser/fileapi/file_stream_reader.h" |
8 #include "storage/browser/fileapi/file_stream_writer.h" | 8 #include "storage/browser/fileapi/file_stream_writer.h" |
9 #include "storage/browser/fileapi/file_system_url.h" | 9 #include "storage/browser/fileapi/file_system_url.h" |
10 | 10 |
(...skipping 11 matching lines...) Expand all Loading... |
22 MTPFileSystemBackendDelegate::~MTPFileSystemBackendDelegate() { | 22 MTPFileSystemBackendDelegate::~MTPFileSystemBackendDelegate() { |
23 } | 23 } |
24 | 24 |
25 storage::AsyncFileUtil* MTPFileSystemBackendDelegate::GetAsyncFileUtil( | 25 storage::AsyncFileUtil* MTPFileSystemBackendDelegate::GetAsyncFileUtil( |
26 storage::FileSystemType type) { | 26 storage::FileSystemType type) { |
27 DCHECK_EQ(storage::kFileSystemTypeDeviceMediaAsFileStorage, type); | 27 DCHECK_EQ(storage::kFileSystemTypeDeviceMediaAsFileStorage, type); |
28 | 28 |
29 return device_media_async_file_util_.get(); | 29 return device_media_async_file_util_.get(); |
30 } | 30 } |
31 | 31 |
32 scoped_ptr<storage::FileStreamReader> | 32 std::unique_ptr<storage::FileStreamReader> |
33 MTPFileSystemBackendDelegate::CreateFileStreamReader( | 33 MTPFileSystemBackendDelegate::CreateFileStreamReader( |
34 const storage::FileSystemURL& url, | 34 const storage::FileSystemURL& url, |
35 int64_t offset, | 35 int64_t offset, |
36 int64_t max_bytes_to_read, | 36 int64_t max_bytes_to_read, |
37 const base::Time& expected_modification_time, | 37 const base::Time& expected_modification_time, |
38 storage::FileSystemContext* context) { | 38 storage::FileSystemContext* context) { |
39 DCHECK_EQ(storage::kFileSystemTypeDeviceMediaAsFileStorage, url.type()); | 39 DCHECK_EQ(storage::kFileSystemTypeDeviceMediaAsFileStorage, url.type()); |
40 | 40 |
41 return device_media_async_file_util_->GetFileStreamReader( | 41 return device_media_async_file_util_->GetFileStreamReader( |
42 url, offset, expected_modification_time, context); | 42 url, offset, expected_modification_time, context); |
43 } | 43 } |
44 | 44 |
45 scoped_ptr<storage::FileStreamWriter> | 45 std::unique_ptr<storage::FileStreamWriter> |
46 MTPFileSystemBackendDelegate::CreateFileStreamWriter( | 46 MTPFileSystemBackendDelegate::CreateFileStreamWriter( |
47 const storage::FileSystemURL& url, | 47 const storage::FileSystemURL& url, |
48 int64_t offset, | 48 int64_t offset, |
49 storage::FileSystemContext* context) { | 49 storage::FileSystemContext* context) { |
50 DCHECK_EQ(storage::kFileSystemTypeDeviceMediaAsFileStorage, url.type()); | 50 DCHECK_EQ(storage::kFileSystemTypeDeviceMediaAsFileStorage, url.type()); |
51 | 51 |
52 // TODO(kinaba): support writing. | 52 // TODO(kinaba): support writing. |
53 return scoped_ptr<storage::FileStreamWriter>(); | 53 return std::unique_ptr<storage::FileStreamWriter>(); |
54 } | 54 } |
55 | 55 |
56 storage::WatcherManager* MTPFileSystemBackendDelegate::GetWatcherManager( | 56 storage::WatcherManager* MTPFileSystemBackendDelegate::GetWatcherManager( |
57 storage::FileSystemType type) { | 57 storage::FileSystemType type) { |
58 DCHECK_EQ(storage::kFileSystemTypeDeviceMediaAsFileStorage, type); | 58 DCHECK_EQ(storage::kFileSystemTypeDeviceMediaAsFileStorage, type); |
59 return mtp_watcher_manager_.get(); | 59 return mtp_watcher_manager_.get(); |
60 } | 60 } |
61 | 61 |
62 void MTPFileSystemBackendDelegate::GetRedirectURLForContents( | 62 void MTPFileSystemBackendDelegate::GetRedirectURLForContents( |
63 const storage::FileSystemURL& url, | 63 const storage::FileSystemURL& url, |
64 const storage::URLCallback& callback) { | 64 const storage::URLCallback& callback) { |
65 DCHECK_EQ(storage::kFileSystemTypeDeviceMediaAsFileStorage, url.type()); | 65 DCHECK_EQ(storage::kFileSystemTypeDeviceMediaAsFileStorage, url.type()); |
66 | 66 |
67 callback.Run(GURL()); | 67 callback.Run(GURL()); |
68 } | 68 } |
69 | 69 |
70 } // namespace chromeos | 70 } // namespace chromeos |
OLD | NEW |