OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 #ifndef STORAGE_BROWSER_FILEAPI_ASYNC_FILE_UTIL_H_ | 5 #ifndef STORAGE_BROWSER_FILEAPI_ASYNC_FILE_UTIL_H_ |
6 #define STORAGE_BROWSER_FILEAPI_ASYNC_FILE_UTIL_H_ | 6 #define STORAGE_BROWSER_FILEAPI_ASYNC_FILE_UTIL_H_ |
7 | 7 |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
73 typedef base::Callback< | 73 typedef base::Callback< |
74 void(base::File::Error result, | 74 void(base::File::Error result, |
75 const base::File::Info& file_info, | 75 const base::File::Info& file_info, |
76 const base::FilePath& platform_path, | 76 const base::FilePath& platform_path, |
77 const scoped_refptr<storage::ShareableFileReference>& file_ref)> | 77 const scoped_refptr<storage::ShareableFileReference>& file_ref)> |
78 CreateSnapshotFileCallback; | 78 CreateSnapshotFileCallback; |
79 | 79 |
80 typedef base::Callback<void(int64 size)> CopyFileProgressCallback; | 80 typedef base::Callback<void(int64 size)> CopyFileProgressCallback; |
81 | 81 |
82 typedef FileSystemOperation::CopyOrMoveOption CopyOrMoveOption; | 82 typedef FileSystemOperation::CopyOrMoveOption CopyOrMoveOption; |
| 83 typedef FileSystemOperation::GetMetadataField GetMetadataField; |
83 | 84 |
84 // Creates an AsyncFileUtil instance which performs file operations on | 85 // Creates an AsyncFileUtil instance which performs file operations on |
85 // local native file system. The created instance assumes | 86 // local native file system. The created instance assumes |
86 // FileSystemURL::path() has the target platform path. | 87 // FileSystemURL::path() has the target platform path. |
87 STORAGE_EXPORT static AsyncFileUtil* | 88 STORAGE_EXPORT static AsyncFileUtil* |
88 CreateForLocalFileSystem(); | 89 CreateForLocalFileSystem(); |
89 | 90 |
90 AsyncFileUtil() {} | 91 AsyncFileUtil() {} |
91 virtual ~AsyncFileUtil() {} | 92 virtual ~AsyncFileUtil() {} |
92 | 93 |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
142 const StatusCallback& callback) = 0; | 143 const StatusCallback& callback) = 0; |
143 | 144 |
144 // Retrieves the information about a file. | 145 // Retrieves the information about a file. |
145 // | 146 // |
146 // FileSystemOperationImpl::GetMetadata calls this. | 147 // FileSystemOperationImpl::GetMetadata calls this. |
147 // | 148 // |
148 // This reports following error code via |callback|: | 149 // This reports following error code via |callback|: |
149 // - File::FILE_ERROR_NOT_FOUND if the file doesn't exist. | 150 // - File::FILE_ERROR_NOT_FOUND if the file doesn't exist. |
150 // - Other error code if there was an error while retrieving the file info. | 151 // - Other error code if there was an error while retrieving the file info. |
151 // | 152 // |
152 virtual void GetFileInfo( | 153 virtual void GetFileInfo(scoped_ptr<FileSystemOperationContext> context, |
153 scoped_ptr<FileSystemOperationContext> context, | 154 const FileSystemURL& url, |
154 const FileSystemURL& url, | 155 int fields, |
155 const GetFileInfoCallback& callback) = 0; | 156 const GetFileInfoCallback& callback) = 0; |
156 | 157 |
157 // Reads contents of a directory at |path|. | 158 // Reads contents of a directory at |path|. |
158 // | 159 // |
159 // FileSystemOperationImpl::ReadDirectory calls this. | 160 // FileSystemOperationImpl::ReadDirectory calls this. |
160 // | 161 // |
161 // Note that the |name| field of each entry in |file_list| | 162 // Note that the |name| field of each entry in |file_list| |
162 // returned by |callback| should have a base file name | 163 // returned by |callback| should have a base file name |
163 // of the entry relative to the directory, but not an absolute path. | 164 // of the entry relative to the directory, but not an absolute path. |
164 // | 165 // |
165 // (E.g. if ReadDirectory is called for a directory | 166 // (E.g. if ReadDirectory is called for a directory |
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
357 const FileSystemURL& url, | 358 const FileSystemURL& url, |
358 const CreateSnapshotFileCallback& callback) = 0; | 359 const CreateSnapshotFileCallback& callback) = 0; |
359 | 360 |
360 private: | 361 private: |
361 DISALLOW_COPY_AND_ASSIGN(AsyncFileUtil); | 362 DISALLOW_COPY_AND_ASSIGN(AsyncFileUtil); |
362 }; | 363 }; |
363 | 364 |
364 } // namespace storage | 365 } // namespace storage |
365 | 366 |
366 #endif // STORAGE_BROWSER_FILEAPI_ASYNC_FILE_UTIL_H_ | 367 #endif // STORAGE_BROWSER_FILEAPI_ASYNC_FILE_UTIL_H_ |
OLD | NEW |