| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/arc/fileapi/arc_documents_provider_backend_del
egate.h" | 5 #include "chrome/browser/chromeos/arc/fileapi/arc_documents_provider_backend_del
egate.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/memory/ptr_util.h" |
| 11 #include "chrome/browser/chromeos/arc/fileapi/arc_documents_provider_file_stream
_reader.h" |
| 10 #include "content/public/browser/browser_thread.h" | 12 #include "content/public/browser/browser_thread.h" |
| 11 #include "storage/browser/fileapi/file_stream_reader.h" | 13 #include "storage/browser/fileapi/file_stream_reader.h" |
| 12 #include "storage/browser/fileapi/file_stream_writer.h" | 14 #include "storage/browser/fileapi/file_stream_writer.h" |
| 13 #include "url/gurl.h" | 15 #include "url/gurl.h" |
| 14 | 16 |
| 15 using content::BrowserThread; | 17 using content::BrowserThread; |
| 16 | 18 |
| 17 namespace arc { | 19 namespace arc { |
| 18 | 20 |
| 19 ArcDocumentsProviderBackendDelegate::ArcDocumentsProviderBackendDelegate() | 21 ArcDocumentsProviderBackendDelegate::ArcDocumentsProviderBackendDelegate() |
| (...skipping 10 matching lines...) Expand all Loading... |
| 30 } | 32 } |
| 31 | 33 |
| 32 std::unique_ptr<storage::FileStreamReader> | 34 std::unique_ptr<storage::FileStreamReader> |
| 33 ArcDocumentsProviderBackendDelegate::CreateFileStreamReader( | 35 ArcDocumentsProviderBackendDelegate::CreateFileStreamReader( |
| 34 const storage::FileSystemURL& url, | 36 const storage::FileSystemURL& url, |
| 35 int64_t offset, | 37 int64_t offset, |
| 36 int64_t max_bytes_to_read, | 38 int64_t max_bytes_to_read, |
| 37 const base::Time& expected_modification_time, | 39 const base::Time& expected_modification_time, |
| 38 storage::FileSystemContext* context) { | 40 storage::FileSystemContext* context) { |
| 39 DCHECK_CURRENTLY_ON(BrowserThread::IO); | 41 DCHECK_CURRENTLY_ON(BrowserThread::IO); |
| 40 NOTIMPLEMENTED(); // TODO(crbug.com/671511): Implement this function. | 42 |
| 41 return nullptr; | 43 return base::MakeUnique<ArcDocumentsProviderFileStreamReader>(url, offset, |
| 44 &roots_); |
| 42 } | 45 } |
| 43 | 46 |
| 44 std::unique_ptr<storage::FileStreamWriter> | 47 std::unique_ptr<storage::FileStreamWriter> |
| 45 ArcDocumentsProviderBackendDelegate::CreateFileStreamWriter( | 48 ArcDocumentsProviderBackendDelegate::CreateFileStreamWriter( |
| 46 const storage::FileSystemURL& url, | 49 const storage::FileSystemURL& url, |
| 47 int64_t offset, | 50 int64_t offset, |
| 48 storage::FileSystemContext* context) { | 51 storage::FileSystemContext* context) { |
| 49 DCHECK_CURRENTLY_ON(BrowserThread::IO); | 52 DCHECK_CURRENTLY_ON(BrowserThread::IO); |
| 50 NOTREACHED(); // Read-only file system. | 53 NOTREACHED(); // Read-only file system. |
| 51 return nullptr; | 54 return nullptr; |
| 52 } | 55 } |
| 53 | 56 |
| 54 storage::WatcherManager* ArcDocumentsProviderBackendDelegate::GetWatcherManager( | 57 storage::WatcherManager* ArcDocumentsProviderBackendDelegate::GetWatcherManager( |
| 55 storage::FileSystemType type) { | 58 storage::FileSystemType type) { |
| 56 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 59 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
| 57 NOTREACHED(); // Non-watchable file system. | 60 NOTREACHED(); // Non-watchable file system. |
| 58 return nullptr; | 61 return nullptr; |
| 59 } | 62 } |
| 60 | 63 |
| 61 void ArcDocumentsProviderBackendDelegate::GetRedirectURLForContents( | 64 void ArcDocumentsProviderBackendDelegate::GetRedirectURLForContents( |
| 62 const storage::FileSystemURL& url, | 65 const storage::FileSystemURL& url, |
| 63 const storage::URLCallback& callback) { | 66 const storage::URLCallback& callback) { |
| 64 DCHECK_CURRENTLY_ON(BrowserThread::IO); | 67 DCHECK_CURRENTLY_ON(BrowserThread::IO); |
| 65 NOTIMPLEMENTED(); // TODO(crbug.com/671511): Implement this function. | 68 NOTREACHED(); // Never called by chromeos::FileSystemBackend. |
| 66 callback.Run(GURL()); | 69 callback.Run(GURL()); |
| 67 } | 70 } |
| 68 | 71 |
| 69 } // namespace arc | 72 } // namespace arc |
| OLD | NEW |