Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1179)

Side by Side Diff: chrome/browser/chromeos/arc/fileapi/arc_documents_provider_async_file_util.cc

Issue 2568033002: mediaview: Skeleton for ARC Documents Provider FS. (Closed)
Patch Set: IWYU and comments. Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #include "chrome/browser/chromeos/arc/fileapi/arc_documents_provider_async_file_ util.h"
6
7 #include "base/callback.h"
8 #include "base/files/file.h"
9 #include "base/files/file_path.h"
10 #include "base/logging.h"
11 #include "content/public/browser/browser_thread.h"
12 #include "storage/browser/blob/shareable_file_reference.h"
13
14 using content::BrowserThread;
15
16 namespace arc {
17
18 ArcDocumentsProviderAsyncFileUtil::ArcDocumentsProviderAsyncFileUtil() =
19 default;
20
21 ArcDocumentsProviderAsyncFileUtil::~ArcDocumentsProviderAsyncFileUtil() =
22 default;
23
24 void ArcDocumentsProviderAsyncFileUtil::CreateOrOpen(
25 std::unique_ptr<storage::FileSystemOperationContext> context,
26 const storage::FileSystemURL& url,
27 int file_flags,
28 const CreateOrOpenCallback& callback) {
29 DCHECK_CURRENTLY_ON(BrowserThread::IO);
30 // TODO(nya): Implement this function if it is ever called.
31 NOTIMPLEMENTED();
32 callback.Run(base::File(base::File::FILE_ERROR_INVALID_OPERATION),
33 base::Closure());
34 }
35
36 void ArcDocumentsProviderAsyncFileUtil::EnsureFileExists(
37 std::unique_ptr<storage::FileSystemOperationContext> context,
38 const storage::FileSystemURL& url,
39 const EnsureFileExistsCallback& callback) {
40 DCHECK_CURRENTLY_ON(BrowserThread::IO);
41 NOTREACHED(); // Read-only file system.
42 callback.Run(base::File::FILE_ERROR_ACCESS_DENIED, false);
43 }
44
45 void ArcDocumentsProviderAsyncFileUtil::CreateDirectory(
46 std::unique_ptr<storage::FileSystemOperationContext> context,
47 const storage::FileSystemURL& url,
48 bool exclusive,
49 bool recursive,
50 const StatusCallback& callback) {
51 DCHECK_CURRENTLY_ON(BrowserThread::IO);
52 NOTREACHED(); // Read-only file system.
53 callback.Run(base::File::FILE_ERROR_ACCESS_DENIED);
54 }
55
56 void ArcDocumentsProviderAsyncFileUtil::GetFileInfo(
57 std::unique_ptr<storage::FileSystemOperationContext> context,
58 const storage::FileSystemURL& url,
59 int fields,
60 const GetFileInfoCallback& callback) {
61 DCHECK_CURRENTLY_ON(BrowserThread::IO);
62 NOTIMPLEMENTED(); // TODO(crbug.com/671511): Implement this function.
63 callback.Run(base::File::FILE_ERROR_NOT_FOUND, base::File::Info());
64 }
65
66 void ArcDocumentsProviderAsyncFileUtil::ReadDirectory(
67 std::unique_ptr<storage::FileSystemOperationContext> context,
68 const storage::FileSystemURL& url,
69 const ReadDirectoryCallback& callback) {
70 DCHECK_CURRENTLY_ON(BrowserThread::IO);
71 NOTIMPLEMENTED(); // TODO(crbug.com/671511): Implement this function.
72 callback.Run(base::File::FILE_ERROR_NOT_FOUND, EntryList(),
73 false /* has_more */);
74 }
75
76 void ArcDocumentsProviderAsyncFileUtil::Touch(
77 std::unique_ptr<storage::FileSystemOperationContext> context,
78 const storage::FileSystemURL& url,
79 const base::Time& last_access_time,
80 const base::Time& last_modified_time,
81 const StatusCallback& callback) {
82 DCHECK_CURRENTLY_ON(BrowserThread::IO);
83 NOTREACHED(); // Read-only file system.
84 callback.Run(base::File::FILE_ERROR_ACCESS_DENIED);
85 }
86
87 void ArcDocumentsProviderAsyncFileUtil::Truncate(
88 std::unique_ptr<storage::FileSystemOperationContext> context,
89 const storage::FileSystemURL& url,
90 int64_t length,
91 const StatusCallback& callback) {
92 DCHECK_CURRENTLY_ON(BrowserThread::IO);
93 NOTREACHED(); // Read-only file system.
94 callback.Run(base::File::FILE_ERROR_ACCESS_DENIED);
95 }
96
97 void ArcDocumentsProviderAsyncFileUtil::CopyFileLocal(
98 std::unique_ptr<storage::FileSystemOperationContext> context,
99 const storage::FileSystemURL& src_url,
100 const storage::FileSystemURL& dest_url,
101 CopyOrMoveOption option,
102 const CopyFileProgressCallback& progress_callback,
103 const StatusCallback& callback) {
104 DCHECK_CURRENTLY_ON(BrowserThread::IO);
105 NOTREACHED(); // Read-only file system.
106 callback.Run(base::File::FILE_ERROR_ACCESS_DENIED);
107 }
108
109 void ArcDocumentsProviderAsyncFileUtil::MoveFileLocal(
110 std::unique_ptr<storage::FileSystemOperationContext> context,
111 const storage::FileSystemURL& src_url,
112 const storage::FileSystemURL& dest_url,
113 CopyOrMoveOption option,
114 const StatusCallback& callback) {
115 DCHECK_CURRENTLY_ON(BrowserThread::IO);
116 NOTREACHED(); // Read-only file system.
117 callback.Run(base::File::FILE_ERROR_ACCESS_DENIED);
118 }
119
120 void ArcDocumentsProviderAsyncFileUtil::CopyInForeignFile(
121 std::unique_ptr<storage::FileSystemOperationContext> context,
122 const base::FilePath& src_file_path,
123 const storage::FileSystemURL& dest_url,
124 const StatusCallback& callback) {
125 DCHECK_CURRENTLY_ON(BrowserThread::IO);
126 NOTREACHED(); // Read-only file system.
127 callback.Run(base::File::FILE_ERROR_ACCESS_DENIED);
128 }
129
130 void ArcDocumentsProviderAsyncFileUtil::DeleteFile(
131 std::unique_ptr<storage::FileSystemOperationContext> context,
132 const storage::FileSystemURL& url,
133 const StatusCallback& callback) {
134 DCHECK_CURRENTLY_ON(BrowserThread::IO);
135 NOTREACHED(); // Read-only file system.
136 callback.Run(base::File::FILE_ERROR_ACCESS_DENIED);
137 }
138
139 void ArcDocumentsProviderAsyncFileUtil::DeleteDirectory(
140 std::unique_ptr<storage::FileSystemOperationContext> context,
141 const storage::FileSystemURL& url,
142 const StatusCallback& callback) {
143 DCHECK_CURRENTLY_ON(BrowserThread::IO);
144 NOTREACHED(); // Read-only file system.
145 callback.Run(base::File::FILE_ERROR_ACCESS_DENIED);
146 }
147
148 void ArcDocumentsProviderAsyncFileUtil::DeleteRecursively(
149 std::unique_ptr<storage::FileSystemOperationContext> context,
150 const storage::FileSystemURL& url,
151 const StatusCallback& callback) {
152 DCHECK_CURRENTLY_ON(BrowserThread::IO);
153 NOTREACHED(); // Read-only file system.
154 callback.Run(base::File::FILE_ERROR_ACCESS_DENIED);
155 }
156
157 void ArcDocumentsProviderAsyncFileUtil::CreateSnapshotFile(
158 std::unique_ptr<storage::FileSystemOperationContext> context,
159 const storage::FileSystemURL& url,
160 const CreateSnapshotFileCallback& callback) {
161 DCHECK_CURRENTLY_ON(BrowserThread::IO);
162 NOTIMPLEMENTED(); // TODO(crbug.com/671511): Implement this function.
163 callback.Run(base::File::FILE_ERROR_FAILED, base::File::Info(),
164 base::FilePath(),
165 scoped_refptr<storage::ShareableFileReference>());
166 }
167
168 } // namespace arc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698