| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 WEBKIT_CHROMEOS_FILEAPI_REMOTE_FILE_SYSTEM_PROXY_H_ | 5 #ifndef WEBKIT_CHROMEOS_FILEAPI_REMOTE_FILE_SYSTEM_PROXY_H_ |
| 6 #define WEBKIT_CHROMEOS_FILEAPI_REMOTE_FILE_SYSTEM_PROXY_H_ | 6 #define WEBKIT_CHROMEOS_FILEAPI_REMOTE_FILE_SYSTEM_PROXY_H_ |
| 7 | 7 |
| 8 #include "base/callback.h" | 8 #include "base/callback.h" |
| 9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
| 10 #include "webkit/fileapi/file_system_operation_interface.h" | 10 #include "webkit/fileapi/file_system_operation_interface.h" |
| 11 | 11 |
| 12 class GURL; | 12 class GURL; |
| 13 | 13 |
| 14 namespace fileapi { | 14 namespace fileapi { |
| 15 | 15 |
| 16 // The interface class for remote file system proxy. | 16 // The interface class for remote file system proxy. |
| 17 class RemoteFileSystemProxyInterface : | 17 class RemoteFileSystemProxyInterface : |
| 18 public base::RefCountedThreadSafe<RemoteFileSystemProxyInterface> { | 18 public base::RefCountedThreadSafe<RemoteFileSystemProxyInterface> { |
| 19 public: | 19 public: |
| 20 virtual ~RemoteFileSystemProxyInterface() {} | 20 virtual ~RemoteFileSystemProxyInterface() {} |
| 21 | 21 |
| 22 // Gets the file or directory info for given|path|. | 22 // Gets the file or directory info for given|path|. |
| 23 virtual void GetFileInfo(const GURL& path, | 23 virtual void GetFileInfo(const GURL& path, |
| 24 const FileSystemOperationInterface::GetMetadataCallback& callback) = 0; | 24 const FileSystemOperationInterface::GetMetadataCallback& callback) = 0; |
| 25 | 25 |
| 26 // Copies a file or directory from |src_path| to |dest_path|. If |
| 27 // |src_path| is a directory, the contents of |src_path| are copied to |
| 28 // |dest_path| recursively. A new file or directory is created at |
| 29 // |dest_path| as needed. |
| 30 virtual void Copy( |
| 31 const GURL& src_path, |
| 32 const GURL& dest_path, |
| 33 const FileSystemOperationInterface::StatusCallback& callback) = 0; |
| 34 |
| 35 // Moves a file or directory from |src_path| to |dest_path|. A new file |
| 36 // or directory is created at |dest_path| as needed. |
| 37 virtual void Move( |
| 38 const GURL& src_path, |
| 39 const GURL& dest_path, |
| 40 const FileSystemOperationInterface::StatusCallback& callback) = 0; |
| 41 |
| 26 // Reads contents of a directory at |path|. | 42 // Reads contents of a directory at |path|. |
| 27 virtual void ReadDirectory(const GURL& path, | 43 virtual void ReadDirectory(const GURL& path, |
| 28 const FileSystemOperationInterface::ReadDirectoryCallback& callback) = 0; | 44 const FileSystemOperationInterface::ReadDirectoryCallback& callback) = 0; |
| 29 | 45 |
| 30 // Removes a file or directory at |path|. If |recursive| is true, remove | 46 // Removes a file or directory at |path|. If |recursive| is true, remove |
| 31 // all files and directories under the directory at |path| recursively. | 47 // all files and directories under the directory at |path| recursively. |
| 32 virtual void Remove(const GURL& path, bool recursive, | 48 virtual void Remove(const GURL& path, bool recursive, |
| 33 const FileSystemOperationInterface::StatusCallback& callback) = 0; | 49 const FileSystemOperationInterface::StatusCallback& callback) = 0; |
| 34 | 50 |
| 35 // Creates a directory at |path|. If |exclusive| is true, an error is | 51 // Creates a directory at |path|. If |exclusive| is true, an error is |
| 36 // raised in case a directory is already present at the URL. If | 52 // raised in case a directory is already present at the URL. If |
| 37 // |recursive| is true, create parent directories as needed just like | 53 // |recursive| is true, create parent directories as needed just like |
| 38 // mkdir -p does. | 54 // mkdir -p does. |
| 39 virtual void CreateDirectory( | 55 virtual void CreateDirectory( |
| 40 const GURL& path, | 56 const GURL& path, |
| 41 bool exclusive, | 57 bool exclusive, |
| 42 bool recursive, | 58 bool recursive, |
| 43 const FileSystemOperationInterface::StatusCallback& callback) = 0; | 59 const FileSystemOperationInterface::StatusCallback& callback) = 0; |
| 44 | 60 |
| 45 // TODO(zelidrag): More methods to follow as we implement other parts of FSO. | 61 // TODO(zelidrag): More methods to follow as we implement other parts of FSO. |
| 46 }; | 62 }; |
| 47 | 63 |
| 48 } // namespace chromeos | 64 } // namespace chromeos |
| 49 | 65 |
| 50 #endif // WEBKIT_CHROMEOS_FILEAPI_REMOTE_FILE_SYSTEM_PROXY_H_ | 66 #endif // WEBKIT_CHROMEOS_FILEAPI_REMOTE_FILE_SYSTEM_PROXY_H_ |
| OLD | NEW |