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 typedef base::Callback< | 16 typedef base::Callback< |
17 void(base::PlatformFileError result, | 17 void(base::PlatformFileError result, |
18 const FilePath& platform_path, | 18 const FilePath& platform_path, |
19 const scoped_refptr<webkit_blob::ShareableFileReference>& file_ref)> | 19 const scoped_refptr<webkit_blob::ShareableFileReference>& file_ref)> |
20 WritableSnapshotFile; | 20 WritableSnapshotFile; |
21 | 21 |
22 // The interface class for remote file system proxy. | 22 // The interface class for remote file system proxy. |
23 class RemoteFileSystemProxyInterface : | 23 class RemoteFileSystemProxyInterface : |
24 public base::RefCountedThreadSafe<RemoteFileSystemProxyInterface> { | 24 public base::RefCountedThreadSafe<RemoteFileSystemProxyInterface> { |
25 public: | 25 public: |
26 virtual ~RemoteFileSystemProxyInterface() {} | |
27 | |
28 // Gets the file or directory info for given|path|. | 26 // Gets the file or directory info for given|path|. |
29 virtual void GetFileInfo(const GURL& path, | 27 virtual void GetFileInfo(const GURL& path, |
30 const FileSystemOperationInterface::GetMetadataCallback& callback) = 0; | 28 const FileSystemOperationInterface::GetMetadataCallback& callback) = 0; |
31 | 29 |
32 // Copies a file or directory from |src_path| to |dest_path|. If | 30 // Copies a file or directory from |src_path| to |dest_path|. If |
33 // |src_path| is a directory, the contents of |src_path| are copied to | 31 // |src_path| is a directory, the contents of |src_path| are copied to |
34 // |dest_path| recursively. A new file or directory is created at | 32 // |dest_path| recursively. A new file or directory is created at |
35 // |dest_path| as needed. | 33 // |dest_path| as needed. |
36 virtual void Copy( | 34 virtual void Copy( |
37 const GURL& src_path, | 35 const GURL& src_path, |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
88 const WritableSnapshotFile& callback) = 0; | 86 const WritableSnapshotFile& callback) = 0; |
89 | 87 |
90 // Opens file for a give |path| with specified |flags| (see | 88 // Opens file for a give |path| with specified |flags| (see |
91 // base::PlatformFileFlags for details). | 89 // base::PlatformFileFlags for details). |
92 virtual void OpenFile( | 90 virtual void OpenFile( |
93 const GURL& path, | 91 const GURL& path, |
94 int flags, | 92 int flags, |
95 base::ProcessHandle peer_handle, | 93 base::ProcessHandle peer_handle, |
96 const FileSystemOperationInterface::OpenFileCallback& callback) = 0; | 94 const FileSystemOperationInterface::OpenFileCallback& callback) = 0; |
97 // TODO(zelidrag): More methods to follow as we implement other parts of FSO. | 95 // TODO(zelidrag): More methods to follow as we implement other parts of FSO. |
| 96 |
| 97 protected: |
| 98 friend class base::RefCountedThreadSafe<RemoteFileSystemProxyInterface>; |
| 99 virtual ~RemoteFileSystemProxyInterface() {} |
98 }; | 100 }; |
99 | 101 |
100 } // namespace fileapi | 102 } // namespace fileapi |
101 | 103 |
102 #endif // WEBKIT_CHROMEOS_FILEAPI_REMOTE_FILE_SYSTEM_PROXY_H_ | 104 #endif // WEBKIT_CHROMEOS_FILEAPI_REMOTE_FILE_SYSTEM_PROXY_H_ |
OLD | NEW |