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
3 // found in the LICENSE file.
5 #include "chrome/browser/local_discovery/storage/privet_filesystem_async_util.h"
7 #include "base/platform_file.h"
8 #include "webkit/browser/fileapi/file_system_url.h"
9 #include "webkit/common/blob/shareable_file_reference.h"
11 namespace local_discovery {
13 void PrivetFileSystemAsyncUtil::CreateOrOpen(
14 scoped_ptr<fileapi::FileSystemOperationContext> context,
15 const fileapi::FileSystemURL& url,
17 const CreateOrOpenCallback& callback) {
19 callback.Run(base::File::FILE_ERROR_INVALID_OPERATION,
20 base::PassPlatformFile(NULL),
24 void PrivetFileSystemAsyncUtil::EnsureFileExists(
25 scoped_ptr<fileapi::FileSystemOperationContext> context,
26 const fileapi::FileSystemURL& url,
27 const EnsureFileExistsCallback& callback) {
29 callback.Run(base::File::FILE_ERROR_INVALID_OPERATION, false);
32 void PrivetFileSystemAsyncUtil::CreateDirectory(
33 scoped_ptr<fileapi::FileSystemOperationContext> context,
34 const fileapi::FileSystemURL& url,
37 const StatusCallback& callback) {
39 callback.Run(base::File::FILE_ERROR_INVALID_OPERATION);
42 void PrivetFileSystemAsyncUtil::GetFileInfo(
43 scoped_ptr<fileapi::FileSystemOperationContext> context,
44 const fileapi::FileSystemURL& url,
45 const GetFileInfoCallback& callback) {
46 base::File::Info file_info;
49 file_info.is_directory = true;
50 file_info.is_symbolic_link = false;
52 callback.Run(base::File::FILE_OK, file_info);
55 void PrivetFileSystemAsyncUtil::ReadDirectory(
56 scoped_ptr<fileapi::FileSystemOperationContext> context,
57 const fileapi::FileSystemURL& url,
58 const ReadDirectoryCallback& callback) {
61 fileapi::DirectoryEntry entry("Random file",
62 fileapi::DirectoryEntry::FILE,
65 entry_list.push_back(entry);
67 callback.Run(base::File::FILE_OK, entry_list, false);
70 void PrivetFileSystemAsyncUtil::Touch(
71 scoped_ptr<fileapi::FileSystemOperationContext> context,
72 const fileapi::FileSystemURL& url,
73 const base::Time& last_access_time,
74 const base::Time& last_modified_time,
75 const StatusCallback& callback) {
77 callback.Run(base::File::FILE_ERROR_INVALID_OPERATION);
80 void PrivetFileSystemAsyncUtil::Truncate(
81 scoped_ptr<fileapi::FileSystemOperationContext> context,
82 const fileapi::FileSystemURL& url,
84 const StatusCallback& callback) {
86 callback.Run(base::File::FILE_ERROR_INVALID_OPERATION);
89 void PrivetFileSystemAsyncUtil::CopyFileLocal(
90 scoped_ptr<fileapi::FileSystemOperationContext> context,
91 const fileapi::FileSystemURL& src_url,
92 const fileapi::FileSystemURL& dest_url,
93 CopyOrMoveOption option,
94 const CopyFileProgressCallback& progress_callback,
95 const StatusCallback& callback) {
97 callback.Run(base::File::FILE_ERROR_INVALID_OPERATION);
100 void PrivetFileSystemAsyncUtil::MoveFileLocal(
101 scoped_ptr<fileapi::FileSystemOperationContext> context,
102 const fileapi::FileSystemURL& src_url,
103 const fileapi::FileSystemURL& dest_url,
104 CopyOrMoveOption option,
105 const StatusCallback& callback) {
107 callback.Run(base::File::FILE_ERROR_INVALID_OPERATION);
110 void PrivetFileSystemAsyncUtil::CopyInForeignFile(
111 scoped_ptr<fileapi::FileSystemOperationContext> context,
112 const base::FilePath& src_file_path,
113 const fileapi::FileSystemURL& dest_url,
114 const StatusCallback& callback) {
116 callback.Run(base::File::FILE_ERROR_INVALID_OPERATION);
119 void PrivetFileSystemAsyncUtil::DeleteFile(
120 scoped_ptr<fileapi::FileSystemOperationContext> context,
121 const fileapi::FileSystemURL& url,
122 const StatusCallback& callback) {
124 callback.Run(base::File::FILE_ERROR_INVALID_OPERATION);
127 void PrivetFileSystemAsyncUtil::DeleteDirectory(
128 scoped_ptr<fileapi::FileSystemOperationContext> context,
129 const fileapi::FileSystemURL& url,
130 const StatusCallback& callback) {
132 callback.Run(base::File::FILE_ERROR_INVALID_OPERATION);
135 void PrivetFileSystemAsyncUtil::DeleteRecursively(
136 scoped_ptr<fileapi::FileSystemOperationContext> context,
137 const fileapi::FileSystemURL& url,
138 const StatusCallback& callback) {
140 callback.Run(base::File::FILE_ERROR_INVALID_OPERATION);
143 void PrivetFileSystemAsyncUtil::CreateSnapshotFile(
144 scoped_ptr<fileapi::FileSystemOperationContext> context,
145 const fileapi::FileSystemURL& url,
146 const CreateSnapshotFileCallback& callback) {
148 callback.Run(base::File::FILE_ERROR_INVALID_OPERATION,
151 scoped_refptr<webkit_blob::ShareableFileReference>());
154 } // namespace local_discovery