OLD | NEW |
---|---|
(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/bind.h" | |
Yusuke Sato
2016/12/13 18:58:56
nit: unused?
Shuhei Takahashi
2016/12/14 03:24:55
Done.
| |
8 #include "base/callback.h" | |
9 #include "base/files/file.h" | |
10 #include "base/files/file_path.h" | |
11 #include "base/logging.h" | |
12 #include "base/memory/ptr_util.h" | |
Yusuke Sato
2016/12/13 18:58:55
nit: unused?
Shuhei Takahashi
2016/12/14 03:24:55
Done.
| |
13 #include "content/public/browser/browser_thread.h" | |
14 #include "storage/browser/blob/shareable_file_reference.h" | |
15 #include "storage/browser/fileapi/file_system_context.h" | |
Yusuke Sato
2016/12/13 18:58:55
nit: same (line 15-18)
Shuhei Takahashi
2016/12/14 03:24:55
Done.
| |
16 #include "storage/browser/fileapi/file_system_operation_context.h" | |
17 #include "storage/browser/fileapi/file_system_operation_runner.h" | |
18 #include "storage/browser/fileapi/file_system_url.h" | |
19 | |
20 using content::BrowserThread; | |
21 | |
22 namespace arc { | |
23 | |
24 ArcDocumentsProviderAsyncFileUtil::ArcDocumentsProviderAsyncFileUtil() = | |
25 default; | |
26 | |
27 ArcDocumentsProviderAsyncFileUtil::~ArcDocumentsProviderAsyncFileUtil() = | |
28 default; | |
29 | |
30 void ArcDocumentsProviderAsyncFileUtil::CreateOrOpen( | |
31 std::unique_ptr<storage::FileSystemOperationContext> context, | |
32 const storage::FileSystemURL& url, | |
33 int file_flags, | |
34 const CreateOrOpenCallback& callback) { | |
35 DCHECK_CURRENTLY_ON(BrowserThread::IO); | |
36 NOTIMPLEMENTED(); | |
Luis Héctor Chávez
2016/12/13 19:10:51
Can you also add the TODO here and in L167 for con
Shuhei Takahashi
2016/12/14 03:24:55
Done.
| |
37 callback.Run(base::File(base::File::FILE_ERROR_INVALID_OPERATION), | |
38 base::Closure()); | |
39 } | |
40 | |
41 void ArcDocumentsProviderAsyncFileUtil::EnsureFileExists( | |
42 std::unique_ptr<storage::FileSystemOperationContext> context, | |
43 const storage::FileSystemURL& url, | |
44 const EnsureFileExistsCallback& callback) { | |
45 DCHECK_CURRENTLY_ON(BrowserThread::IO); | |
46 NOTREACHED(); // Read-only file system. | |
47 callback.Run(base::File::FILE_ERROR_ACCESS_DENIED, false); | |
48 } | |
49 | |
50 void ArcDocumentsProviderAsyncFileUtil::CreateDirectory( | |
51 std::unique_ptr<storage::FileSystemOperationContext> context, | |
52 const storage::FileSystemURL& url, | |
53 bool exclusive, | |
54 bool recursive, | |
55 const StatusCallback& callback) { | |
56 DCHECK_CURRENTLY_ON(BrowserThread::IO); | |
57 NOTREACHED(); // Read-only file system. | |
58 callback.Run(base::File::FILE_ERROR_ACCESS_DENIED); | |
59 } | |
60 | |
61 void ArcDocumentsProviderAsyncFileUtil::GetFileInfo( | |
62 std::unique_ptr<storage::FileSystemOperationContext> context, | |
63 const storage::FileSystemURL& url, | |
64 int fields, | |
65 const GetFileInfoCallback& callback) { | |
66 DCHECK_CURRENTLY_ON(BrowserThread::IO); | |
67 NOTIMPLEMENTED(); // TODO(crbug.com/671511): Implement this function. | |
68 callback.Run(base::File::FILE_ERROR_NOT_FOUND, base::File::Info()); | |
69 } | |
70 | |
71 void ArcDocumentsProviderAsyncFileUtil::ReadDirectory( | |
72 std::unique_ptr<storage::FileSystemOperationContext> context, | |
73 const storage::FileSystemURL& url, | |
74 const ReadDirectoryCallback& callback) { | |
75 DCHECK_CURRENTLY_ON(BrowserThread::IO); | |
76 NOTIMPLEMENTED(); // TODO(crbug.com/671511): Implement this function. | |
77 callback.Run(base::File::FILE_ERROR_NOT_FOUND, EntryList(), | |
78 false /* has_more */); | |
79 } | |
80 | |
81 void ArcDocumentsProviderAsyncFileUtil::Touch( | |
82 std::unique_ptr<storage::FileSystemOperationContext> context, | |
83 const storage::FileSystemURL& url, | |
84 const base::Time& last_access_time, | |
85 const base::Time& last_modified_time, | |
86 const StatusCallback& callback) { | |
87 DCHECK_CURRENTLY_ON(BrowserThread::IO); | |
88 NOTREACHED(); // Read-only file system. | |
89 callback.Run(base::File::FILE_ERROR_ACCESS_DENIED); | |
90 } | |
91 | |
92 void ArcDocumentsProviderAsyncFileUtil::Truncate( | |
93 std::unique_ptr<storage::FileSystemOperationContext> context, | |
94 const storage::FileSystemURL& url, | |
95 int64_t length, | |
96 const StatusCallback& callback) { | |
97 DCHECK_CURRENTLY_ON(BrowserThread::IO); | |
98 NOTREACHED(); // Read-only file system. | |
99 callback.Run(base::File::FILE_ERROR_ACCESS_DENIED); | |
100 } | |
101 | |
102 void ArcDocumentsProviderAsyncFileUtil::CopyFileLocal( | |
103 std::unique_ptr<storage::FileSystemOperationContext> context, | |
104 const storage::FileSystemURL& src_url, | |
105 const storage::FileSystemURL& dest_url, | |
106 CopyOrMoveOption option, | |
107 const CopyFileProgressCallback& progress_callback, | |
108 const StatusCallback& callback) { | |
109 DCHECK_CURRENTLY_ON(BrowserThread::IO); | |
110 NOTREACHED(); // Read-only file system. | |
111 callback.Run(base::File::FILE_ERROR_ACCESS_DENIED); | |
112 } | |
113 | |
114 void ArcDocumentsProviderAsyncFileUtil::MoveFileLocal( | |
115 std::unique_ptr<storage::FileSystemOperationContext> context, | |
116 const storage::FileSystemURL& src_url, | |
117 const storage::FileSystemURL& dest_url, | |
118 CopyOrMoveOption option, | |
119 const StatusCallback& callback) { | |
120 DCHECK_CURRENTLY_ON(BrowserThread::IO); | |
121 NOTREACHED(); // Read-only file system. | |
122 callback.Run(base::File::FILE_ERROR_ACCESS_DENIED); | |
123 } | |
124 | |
125 void ArcDocumentsProviderAsyncFileUtil::CopyInForeignFile( | |
126 std::unique_ptr<storage::FileSystemOperationContext> context, | |
127 const base::FilePath& src_file_path, | |
128 const storage::FileSystemURL& dest_url, | |
129 const StatusCallback& callback) { | |
130 DCHECK_CURRENTLY_ON(BrowserThread::IO); | |
131 NOTREACHED(); // Read-only file system. | |
132 callback.Run(base::File::FILE_ERROR_ACCESS_DENIED); | |
133 } | |
134 | |
135 void ArcDocumentsProviderAsyncFileUtil::DeleteFile( | |
136 std::unique_ptr<storage::FileSystemOperationContext> context, | |
137 const storage::FileSystemURL& url, | |
138 const StatusCallback& callback) { | |
139 DCHECK_CURRENTLY_ON(BrowserThread::IO); | |
140 NOTREACHED(); // Read-only file system. | |
141 callback.Run(base::File::FILE_ERROR_ACCESS_DENIED); | |
142 } | |
143 | |
144 void ArcDocumentsProviderAsyncFileUtil::DeleteDirectory( | |
145 std::unique_ptr<storage::FileSystemOperationContext> context, | |
146 const storage::FileSystemURL& url, | |
147 const StatusCallback& callback) { | |
148 DCHECK_CURRENTLY_ON(BrowserThread::IO); | |
149 NOTREACHED(); // Read-only file system. | |
150 callback.Run(base::File::FILE_ERROR_ACCESS_DENIED); | |
151 } | |
152 | |
153 void ArcDocumentsProviderAsyncFileUtil::DeleteRecursively( | |
154 std::unique_ptr<storage::FileSystemOperationContext> context, | |
155 const storage::FileSystemURL& url, | |
156 const StatusCallback& callback) { | |
157 DCHECK_CURRENTLY_ON(BrowserThread::IO); | |
158 NOTREACHED(); // Read-only file system. | |
159 callback.Run(base::File::FILE_ERROR_ACCESS_DENIED); | |
160 } | |
161 | |
162 void ArcDocumentsProviderAsyncFileUtil::CreateSnapshotFile( | |
163 std::unique_ptr<storage::FileSystemOperationContext> context, | |
164 const storage::FileSystemURL& url, | |
165 const CreateSnapshotFileCallback& callback) { | |
166 DCHECK_CURRENTLY_ON(BrowserThread::IO); | |
167 NOTIMPLEMENTED(); | |
168 callback.Run(base::File::FILE_ERROR_FAILED, base::File::Info(), | |
169 base::FilePath(), | |
170 scoped_refptr<storage::ShareableFileReference>()); | |
171 } | |
172 | |
173 } // namespace arc | |
OLD | NEW |