Upstream version 5.34.104.0
[platform/framework/web/crosswalk.git] / src / chrome / browser / local_discovery / storage / privet_filesystem_async_util.cc
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.
4
5 #include "chrome/browser/local_discovery/storage/privet_filesystem_async_util.h"
6
7 #include "base/platform_file.h"
8 #include "webkit/browser/fileapi/file_system_url.h"
9 #include "webkit/common/blob/shareable_file_reference.h"
10
11 namespace local_discovery {
12
13 void PrivetFileSystemAsyncUtil::CreateOrOpen(
14     scoped_ptr<fileapi::FileSystemOperationContext> context,
15     const fileapi::FileSystemURL& url,
16     int file_flags,
17     const CreateOrOpenCallback& callback) {
18   NOTIMPLEMENTED();
19   callback.Run(base::File::FILE_ERROR_INVALID_OPERATION,
20                base::PassPlatformFile(NULL),
21                base::Closure());
22 }
23
24 void PrivetFileSystemAsyncUtil::EnsureFileExists(
25     scoped_ptr<fileapi::FileSystemOperationContext> context,
26     const fileapi::FileSystemURL& url,
27     const EnsureFileExistsCallback& callback) {
28     NOTIMPLEMENTED();
29     callback.Run(base::File::FILE_ERROR_INVALID_OPERATION, false);
30 }
31
32 void PrivetFileSystemAsyncUtil::CreateDirectory(
33     scoped_ptr<fileapi::FileSystemOperationContext> context,
34     const fileapi::FileSystemURL& url,
35     bool exclusive,
36     bool recursive,
37     const StatusCallback& callback) {
38     NOTIMPLEMENTED();
39     callback.Run(base::File::FILE_ERROR_INVALID_OPERATION);
40 }
41
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;
47
48   file_info.size = 20;
49   file_info.is_directory = true;
50   file_info.is_symbolic_link = false;
51
52   callback.Run(base::File::FILE_OK, file_info);
53 }
54
55 void PrivetFileSystemAsyncUtil::ReadDirectory(
56     scoped_ptr<fileapi::FileSystemOperationContext> context,
57     const fileapi::FileSystemURL& url,
58     const ReadDirectoryCallback& callback) {
59   EntryList entry_list;
60
61   fileapi::DirectoryEntry entry("Random file",
62                                 fileapi::DirectoryEntry::FILE,
63                                 3000,
64                                 base::Time());
65   entry_list.push_back(entry);
66
67   callback.Run(base::File::FILE_OK, entry_list, false);
68 }
69
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) {
76   NOTIMPLEMENTED();
77   callback.Run(base::File::FILE_ERROR_INVALID_OPERATION);
78 }
79
80 void PrivetFileSystemAsyncUtil::Truncate(
81     scoped_ptr<fileapi::FileSystemOperationContext> context,
82     const fileapi::FileSystemURL& url,
83     int64 length,
84     const StatusCallback& callback) {
85   NOTIMPLEMENTED();
86   callback.Run(base::File::FILE_ERROR_INVALID_OPERATION);
87 }
88
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) {
96   NOTIMPLEMENTED();
97   callback.Run(base::File::FILE_ERROR_INVALID_OPERATION);
98 }
99
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) {
106   NOTIMPLEMENTED();
107   callback.Run(base::File::FILE_ERROR_INVALID_OPERATION);
108 }
109
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) {
115   NOTIMPLEMENTED();
116   callback.Run(base::File::FILE_ERROR_INVALID_OPERATION);
117 }
118
119 void PrivetFileSystemAsyncUtil::DeleteFile(
120     scoped_ptr<fileapi::FileSystemOperationContext> context,
121     const fileapi::FileSystemURL& url,
122     const StatusCallback& callback) {
123   NOTIMPLEMENTED();
124   callback.Run(base::File::FILE_ERROR_INVALID_OPERATION);
125 }
126
127 void PrivetFileSystemAsyncUtil::DeleteDirectory(
128     scoped_ptr<fileapi::FileSystemOperationContext> context,
129     const fileapi::FileSystemURL& url,
130     const StatusCallback& callback) {
131   NOTIMPLEMENTED();
132   callback.Run(base::File::FILE_ERROR_INVALID_OPERATION);
133 }
134
135 void PrivetFileSystemAsyncUtil::DeleteRecursively(
136     scoped_ptr<fileapi::FileSystemOperationContext> context,
137     const fileapi::FileSystemURL& url,
138     const StatusCallback& callback) {
139   NOTIMPLEMENTED();
140   callback.Run(base::File::FILE_ERROR_INVALID_OPERATION);
141 }
142
143 void PrivetFileSystemAsyncUtil::CreateSnapshotFile(
144     scoped_ptr<fileapi::FileSystemOperationContext> context,
145     const fileapi::FileSystemURL& url,
146     const CreateSnapshotFileCallback& callback) {
147   NOTIMPLEMENTED();
148   callback.Run(base::File::FILE_ERROR_INVALID_OPERATION,
149                base::File::Info(),
150                base::FilePath(),
151                scoped_refptr<webkit_blob::ShareableFileReference>());
152 }
153
154 }  // namespace local_discovery