Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(121)

Side by Side Diff: chrome/browser/chromeos/gdata/drive_file_system_proxy.h

Issue 10870040: Rename FileSystemOperationInterface to FileSystemOperation (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fixing Created 8 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | chrome/browser/chromeos/gdata/drive_file_system_proxy.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 CHROME_BROWSER_CHROMEOS_GDATA_DRIVE_FILE_SYSTEM_PROXY_H_ 5 #ifndef CHROME_BROWSER_CHROMEOS_GDATA_DRIVE_FILE_SYSTEM_PROXY_H_
6 #define CHROME_BROWSER_CHROMEOS_GDATA_DRIVE_FILE_SYSTEM_PROXY_H_ 6 #define CHROME_BROWSER_CHROMEOS_GDATA_DRIVE_FILE_SYSTEM_PROXY_H_
7 7
8 #include "chrome/browser/chromeos/gdata/drive_file_system_interface.h" 8 #include "chrome/browser/chromeos/gdata/drive_file_system_interface.h"
9 #include "chrome/browser/chromeos/gdata/gdata_errorcode.h" 9 #include "chrome/browser/chromeos/gdata/gdata_errorcode.h"
10 #include "webkit/chromeos/fileapi/remote_file_system_proxy.h" 10 #include "webkit/chromeos/fileapi/remote_file_system_proxy.h"
(...skipping 11 matching lines...) Expand all
22 22
23 // Implementation of File API's remote file system proxy for Drive file system. 23 // Implementation of File API's remote file system proxy for Drive file system.
24 class DriveFileSystemProxy : public fileapi::RemoteFileSystemProxyInterface { 24 class DriveFileSystemProxy : public fileapi::RemoteFileSystemProxyInterface {
25 public: 25 public:
26 // |file_system| is the DriveFileSystem instance owned by GDataSystemService. 26 // |file_system| is the DriveFileSystem instance owned by GDataSystemService.
27 explicit DriveFileSystemProxy(DriveFileSystemInterface* file_system); 27 explicit DriveFileSystemProxy(DriveFileSystemInterface* file_system);
28 28
29 // fileapi::RemoteFileSystemProxyInterface overrides. 29 // fileapi::RemoteFileSystemProxyInterface overrides.
30 virtual void GetFileInfo( 30 virtual void GetFileInfo(
31 const fileapi::FileSystemURL& url, 31 const fileapi::FileSystemURL& url,
32 const fileapi::FileSystemOperationInterface::GetMetadataCallback& 32 const fileapi::FileSystemOperation::GetMetadataCallback&
33 callback) OVERRIDE; 33 callback) OVERRIDE;
34 virtual void Copy( 34 virtual void Copy(
35 const fileapi::FileSystemURL& src_url, 35 const fileapi::FileSystemURL& src_url,
36 const fileapi::FileSystemURL& dest_url, 36 const fileapi::FileSystemURL& dest_url,
37 const fileapi::FileSystemOperationInterface::StatusCallback& callback) 37 const fileapi::FileSystemOperation::StatusCallback& callback)
38 OVERRIDE; 38 OVERRIDE;
39 virtual void Move( 39 virtual void Move(
40 const fileapi::FileSystemURL& src_url, 40 const fileapi::FileSystemURL& src_url,
41 const fileapi::FileSystemURL& dest_url, 41 const fileapi::FileSystemURL& dest_url,
42 const fileapi::FileSystemOperationInterface::StatusCallback& callback) 42 const fileapi::FileSystemOperation::StatusCallback& callback)
43 OVERRIDE; 43 OVERRIDE;
44 virtual void ReadDirectory(const fileapi::FileSystemURL& url, 44 virtual void ReadDirectory(const fileapi::FileSystemURL& url,
45 const fileapi::FileSystemOperationInterface::ReadDirectoryCallback& 45 const fileapi::FileSystemOperation::ReadDirectoryCallback&
46 callback) OVERRIDE; 46 callback) OVERRIDE;
47 virtual void Remove( 47 virtual void Remove(
48 const fileapi::FileSystemURL& url, bool recursive, 48 const fileapi::FileSystemURL& url, bool recursive,
49 const fileapi::FileSystemOperationInterface::StatusCallback& callback) 49 const fileapi::FileSystemOperation::StatusCallback& callback)
50 OVERRIDE; 50 OVERRIDE;
51 virtual void CreateDirectory( 51 virtual void CreateDirectory(
52 const fileapi::FileSystemURL& file_url, 52 const fileapi::FileSystemURL& file_url,
53 bool exclusive, 53 bool exclusive,
54 bool recursive, 54 bool recursive,
55 const fileapi::FileSystemOperationInterface::StatusCallback& callback) 55 const fileapi::FileSystemOperation::StatusCallback& callback)
56 OVERRIDE; 56 OVERRIDE;
57 virtual void CreateFile( 57 virtual void CreateFile(
58 const fileapi::FileSystemURL& file_url, 58 const fileapi::FileSystemURL& file_url,
59 bool exclusive, 59 bool exclusive,
60 const fileapi::FileSystemOperationInterface::StatusCallback& callback) 60 const fileapi::FileSystemOperation::StatusCallback& callback)
61 OVERRIDE; 61 OVERRIDE;
62 virtual void Truncate( 62 virtual void Truncate(
63 const fileapi::FileSystemURL& file_url, int64 length, 63 const fileapi::FileSystemURL& file_url, int64 length,
64 const fileapi::FileSystemOperationInterface::StatusCallback& callback) 64 const fileapi::FileSystemOperation::StatusCallback& callback)
65 OVERRIDE; 65 OVERRIDE;
66 virtual void CreateSnapshotFile( 66 virtual void CreateSnapshotFile(
67 const fileapi::FileSystemURL& url, 67 const fileapi::FileSystemURL& url,
68 const fileapi::FileSystemOperationInterface::SnapshotFileCallback& 68 const fileapi::FileSystemOperation::SnapshotFileCallback&
69 callback) OVERRIDE; 69 callback) OVERRIDE;
70 virtual void CreateWritableSnapshotFile( 70 virtual void CreateWritableSnapshotFile(
71 const fileapi::FileSystemURL& url, 71 const fileapi::FileSystemURL& url,
72 const fileapi::WritableSnapshotFile& callback) OVERRIDE; 72 const fileapi::WritableSnapshotFile& callback) OVERRIDE;
73 virtual void OpenFile( 73 virtual void OpenFile(
74 const fileapi::FileSystemURL& url, 74 const fileapi::FileSystemURL& url,
75 int file_flags, 75 int file_flags,
76 base::ProcessHandle peer_handle, 76 base::ProcessHandle peer_handle,
77 const fileapi::FileSystemOperationInterface::OpenFileCallback& 77 const fileapi::FileSystemOperation::OpenFileCallback&
78 callback) OVERRIDE; 78 callback) OVERRIDE;
79 virtual void NotifyCloseFile(const fileapi::FileSystemURL& url) OVERRIDE; 79 virtual void NotifyCloseFile(const fileapi::FileSystemURL& url) OVERRIDE;
80 // TODO(zelidrag): More methods to follow as we implement other parts of FSO. 80 // TODO(zelidrag): More methods to follow as we implement other parts of FSO.
81 81
82 protected: 82 protected:
83 virtual ~DriveFileSystemProxy(); 83 virtual ~DriveFileSystemProxy();
84 84
85 private: 85 private:
86 // Checks if a given |url| belongs to this file system. If it does, 86 // Checks if a given |url| belongs to this file system. If it does,
87 // the call will return true and fill in |file_path| with a file path of 87 // the call will return true and fill in |file_path| with a file path of
88 // a corresponding element within this file system. 88 // a corresponding element within this file system.
89 static bool ValidateUrl(const fileapi::FileSystemURL& url, 89 static bool ValidateUrl(const fileapi::FileSystemURL& url,
90 FilePath* file_path); 90 FilePath* file_path);
91 91
92 // Helper callback for relaying reply for status callbacks to the 92 // Helper callback for relaying reply for status callbacks to the
93 // calling thread. 93 // calling thread.
94 void OnStatusCallback( 94 void OnStatusCallback(
95 const fileapi::FileSystemOperationInterface::StatusCallback& callback, 95 const fileapi::FileSystemOperation::StatusCallback& callback,
96 DriveFileError error); 96 DriveFileError error);
97 97
98 // Helper callback for relaying reply for metadata retrieval request to the 98 // Helper callback for relaying reply for metadata retrieval request to the
99 // calling thread. 99 // calling thread.
100 void OnGetMetadata( 100 void OnGetMetadata(
101 const FilePath& file_path, 101 const FilePath& file_path,
102 const fileapi::FileSystemOperationInterface::GetMetadataCallback& 102 const fileapi::FileSystemOperation::GetMetadataCallback&
103 callback, 103 callback,
104 DriveFileError error, 104 DriveFileError error,
105 scoped_ptr<DriveEntryProto> entry_proto); 105 scoped_ptr<DriveEntryProto> entry_proto);
106 106
107 // Helper callback for relaying reply for GetEntryInfoByPath() to the 107 // Helper callback for relaying reply for GetEntryInfoByPath() to the
108 // calling thread. 108 // calling thread.
109 void OnGetEntryInfoByPath( 109 void OnGetEntryInfoByPath(
110 const FilePath& entry_path, 110 const FilePath& entry_path,
111 const fileapi::FileSystemOperationInterface::SnapshotFileCallback& 111 const fileapi::FileSystemOperation::SnapshotFileCallback&
112 callback, 112 callback,
113 DriveFileError error, 113 DriveFileError error,
114 scoped_ptr<DriveEntryProto> entry_proto); 114 scoped_ptr<DriveEntryProto> entry_proto);
115 115
116 // Helper callback for relaying reply for ReadDirectory() to the calling 116 // Helper callback for relaying reply for ReadDirectory() to the calling
117 // thread. 117 // thread.
118 void OnReadDirectory( 118 void OnReadDirectory(
119 const fileapi::FileSystemOperationInterface::ReadDirectoryCallback& 119 const fileapi::FileSystemOperation::ReadDirectoryCallback&
120 callback, 120 callback,
121 DriveFileError error, 121 DriveFileError error,
122 bool hide_hosted_documents, 122 bool hide_hosted_documents,
123 scoped_ptr<DriveEntryProtoVector> proto_entries); 123 scoped_ptr<DriveEntryProtoVector> proto_entries);
124 124
125 // Helper callback for relaying reply for CreateWritableSnapshotFile() to 125 // Helper callback for relaying reply for CreateWritableSnapshotFile() to
126 // the calling thread. 126 // the calling thread.
127 void OnCreateWritableSnapshotFile( 127 void OnCreateWritableSnapshotFile(
128 const FilePath& virtual_path, 128 const FilePath& virtual_path,
129 const fileapi::WritableSnapshotFile& callback, 129 const fileapi::WritableSnapshotFile& callback,
130 DriveFileError result, 130 DriveFileError result,
131 const FilePath& local_path); 131 const FilePath& local_path);
132 132
133 // Helper callback for closing the local cache file and committing the dirty 133 // Helper callback for closing the local cache file and committing the dirty
134 // flag. This is triggered when the callback for CreateWritableSnapshotFile 134 // flag. This is triggered when the callback for CreateWritableSnapshotFile
135 // released the refcounted reference to the file. 135 // released the refcounted reference to the file.
136 void CloseWritableSnapshotFile( 136 void CloseWritableSnapshotFile(
137 const FilePath& virtual_path, 137 const FilePath& virtual_path,
138 const FilePath& local_path); 138 const FilePath& local_path);
139 139
140 // Invoked during Truncate() operation. This is called when a local modifiable 140 // Invoked during Truncate() operation. This is called when a local modifiable
141 // cache is ready for truncation. 141 // cache is ready for truncation.
142 void OnFileOpenedForTruncate( 142 void OnFileOpenedForTruncate(
143 const FilePath& virtual_path, 143 const FilePath& virtual_path,
144 int64 length, 144 int64 length,
145 const fileapi::FileSystemOperationInterface::StatusCallback& callback, 145 const fileapi::FileSystemOperation::StatusCallback& callback,
146 DriveFileError open_result, 146 DriveFileError open_result,
147 const FilePath& local_cache_path); 147 const FilePath& local_cache_path);
148 148
149 // Invoked during Truncate() operation. This is called when the truncation of 149 // Invoked during Truncate() operation. This is called when the truncation of
150 // a local cache file is finished on FILE thread. 150 // a local cache file is finished on FILE thread.
151 void DidTruncate( 151 void DidTruncate(
152 const FilePath& virtual_path, 152 const FilePath& virtual_path,
153 const fileapi::FileSystemOperationInterface::StatusCallback& callback, 153 const fileapi::FileSystemOperation::StatusCallback& callback,
154 base::PlatformFileError* truncate_result); 154 base::PlatformFileError* truncate_result);
155 155
156 // Invoked during OpenFile() operation when truncate or write flags are set. 156 // Invoked during OpenFile() operation when truncate or write flags are set.
157 // This is called when a local modifiable cached file is ready for such 157 // This is called when a local modifiable cached file is ready for such
158 // operation. 158 // operation.
159 void OnOpenFileForWriting( 159 void OnOpenFileForWriting(
160 int file_flags, 160 int file_flags,
161 base::ProcessHandle peer_handle, 161 base::ProcessHandle peer_handle,
162 const fileapi::FileSystemOperationInterface::OpenFileCallback& callback, 162 const fileapi::FileSystemOperation::OpenFileCallback& callback,
163 DriveFileError file_error, 163 DriveFileError file_error,
164 const FilePath& local_cache_path); 164 const FilePath& local_cache_path);
165 165
166 // Invoked during OpenFile() operation when file create flags are set. 166 // Invoked during OpenFile() operation when file create flags are set.
167 void OnCreateFileForOpen( 167 void OnCreateFileForOpen(
168 const FilePath& file_path, 168 const FilePath& file_path,
169 int file_flags, 169 int file_flags,
170 base::ProcessHandle peer_handle, 170 base::ProcessHandle peer_handle,
171 const fileapi::FileSystemOperationInterface::OpenFileCallback& callback, 171 const fileapi::FileSystemOperation::OpenFileCallback& callback,
172 DriveFileError file_error); 172 DriveFileError file_error);
173 173
174 // Invoked during OpenFile() operation when base::PLATFORM_FILE_OPEN_TRUNCATED 174 // Invoked during OpenFile() operation when base::PLATFORM_FILE_OPEN_TRUNCATED
175 // flag is set. This is called when the truncation of a local cache file is 175 // flag is set. This is called when the truncation of a local cache file is
176 // finished on FILE thread. 176 // finished on FILE thread.
177 void OnOpenAndTruncate( 177 void OnOpenAndTruncate(
178 base::ProcessHandle peer_handle, 178 base::ProcessHandle peer_handle,
179 const fileapi::FileSystemOperationInterface::OpenFileCallback& callback, 179 const fileapi::FileSystemOperation::OpenFileCallback& callback,
180 base::PlatformFile* platform_file, 180 base::PlatformFile* platform_file,
181 base::PlatformFileError* truncate_result); 181 base::PlatformFileError* truncate_result);
182 182
183 // DriveFileSystem is owned by Profile, which outlives DriveFileSystemProxy, 183 // DriveFileSystem is owned by Profile, which outlives DriveFileSystemProxy,
184 // which is owned by CrosMountPointProvider (i.e. by the time Profile is 184 // which is owned by CrosMountPointProvider (i.e. by the time Profile is
185 // removed, the file manager is already gone). Hence it's safe to use this as 185 // removed, the file manager is already gone). Hence it's safe to use this as
186 // a raw pointer. 186 // a raw pointer.
187 DriveFileSystemInterface* file_system_; 187 DriveFileSystemInterface* file_system_;
188 }; 188 };
189 189
190 } // namespace chromeos 190 } // namespace chromeos
191 191
192 #endif // CHROME_BROWSER_CHROMEOS_GDATA_DRIVE_FILE_SYSTEM_PROXY_H_ 192 #endif // CHROME_BROWSER_CHROMEOS_GDATA_DRIVE_FILE_SYSTEM_PROXY_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/chromeos/gdata/drive_file_system_proxy.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698