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

Side by Side Diff: chrome/browser/chromeos/drive/file_system.h

Issue 118993002: drive: Move FileSystem::LoadDirectoryIfNeeded to ChangeListLoader (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years 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
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_DRIVE_FILE_SYSTEM_H_ 5 #ifndef CHROME_BROWSER_CHROMEOS_DRIVE_FILE_SYSTEM_H_
6 #define CHROME_BROWSER_CHROMEOS_DRIVE_FILE_SYSTEM_H_ 6 #define CHROME_BROWSER_CHROMEOS_DRIVE_FILE_SYSTEM_H_
7 7
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after
168 virtual void OnLoadFromServerComplete() OVERRIDE; 168 virtual void OnLoadFromServerComplete() OVERRIDE;
169 virtual void OnInitialLoadComplete() OVERRIDE; 169 virtual void OnInitialLoadComplete() OVERRIDE;
170 170
171 // Used by tests. 171 // Used by tests.
172 internal::ChangeListLoader* change_list_loader_for_testing() { 172 internal::ChangeListLoader* change_list_loader_for_testing() {
173 return change_list_loader_.get(); 173 return change_list_loader_.get();
174 } 174 }
175 internal::SyncClient* sync_client_for_testing() { return sync_client_.get(); } 175 internal::SyncClient* sync_client_for_testing() { return sync_client_.get(); }
176 176
177 private: 177 private:
178 // Part of Reload(). This is called after the cache and the resource metadata
179 // is cleared, and triggers full feed fetching.
180 void ReloadAfterReset(const FileOperationCallback& callback, FileError error);
181
182 // Used for initialization and Reload(). (Re-)initializes sub components that 178 // Used for initialization and Reload(). (Re-)initializes sub components that
183 // need to be recreated during the reload of resource metadata and the cache. 179 // need to be recreated during the reload of resource metadata and the cache.
184 void ResetComponents(); 180 void ResetComponents();
185 181
186 // Part of CreateDirectory(). Called after ChangeListLoader::LoadIfNeeded() 182 // Part of CreateDirectory(). Called after ChangeListLoader::LoadIfNeeded()
187 // is called and made sure that the resource metadata is loaded. 183 // is called and made sure that the resource metadata is loaded.
188 void CreateDirectoryAfterLoad(const base::FilePath& directory_path, 184 void CreateDirectoryAfterLoad(const base::FilePath& directory_path,
189 bool is_exclusive, 185 bool is_exclusive,
190 bool is_recursive, 186 bool is_recursive,
191 const FileOperationCallback& callback, 187 const FileOperationCallback& callback,
(...skipping 21 matching lines...) Expand all
213 // 1) Called when GetLocallyStoredResourceEntry() is complete. 209 // 1) Called when GetLocallyStoredResourceEntry() is complete.
214 // 2) Called when LoadDirectoryIfNeeded() is complete. 210 // 2) Called when LoadDirectoryIfNeeded() is complete.
215 void GetResourceEntryAfterGetEntry(const base::FilePath& file_path, 211 void GetResourceEntryAfterGetEntry(const base::FilePath& file_path,
216 const GetResourceEntryCallback& callback, 212 const GetResourceEntryCallback& callback,
217 scoped_ptr<ResourceEntry> entry, 213 scoped_ptr<ResourceEntry> entry,
218 FileError error); 214 FileError error);
219 void GetResourceEntryAfterLoad(const base::FilePath& file_path, 215 void GetResourceEntryAfterLoad(const base::FilePath& file_path,
220 const GetResourceEntryCallback& callback, 216 const GetResourceEntryCallback& callback,
221 FileError error); 217 FileError error);
222 218
223 // Loads the entry info of the children of |directory_path| to resource
224 // metadata. |callback| must not be null.
225 void LoadDirectoryIfNeeded(const base::FilePath& directory_path,
226 const FileOperationCallback& callback);
227 void LoadDirectoryIfNeededAfterGetEntry(
228 const base::FilePath& directory_path,
229 const FileOperationCallback& callback,
230 FileError error,
231 scoped_ptr<ResourceEntry> entry);
232
233 // Part of ReadDirectory() 219 // Part of ReadDirectory()
234 // 1) Called when LoadDirectoryIfNeeded() is complete. 220 // 1) Called when LoadDirectoryIfNeeded() is complete.
235 // 2) Called when ResourceMetadata::ReadDirectory() is complete. 221 // 2) Called when ResourceMetadata::ReadDirectory() is complete.
236 // |callback| must not be null. 222 // |callback| must not be null.
237 void ReadDirectoryAfterLoad(const base::FilePath& directory_path, 223 void ReadDirectoryAfterLoad(const base::FilePath& directory_path,
238 const ReadDirectoryCallback& callback, 224 const ReadDirectoryCallback& callback,
239 FileError error); 225 FileError error);
240 void ReadDirectoryAfterRead(const base::FilePath& directory_path, 226 void ReadDirectoryAfterRead(const base::FilePath& directory_path,
241 const ReadDirectoryCallback& callback, 227 const ReadDirectoryCallback& callback,
242 FileError error, 228 FileError error,
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
299 // Note: This should remain the last member so it'll be destroyed and 285 // Note: This should remain the last member so it'll be destroyed and
300 // invalidate the weak pointers before any other members are destroyed. 286 // invalidate the weak pointers before any other members are destroyed.
301 base::WeakPtrFactory<FileSystem> weak_ptr_factory_; 287 base::WeakPtrFactory<FileSystem> weak_ptr_factory_;
302 288
303 DISALLOW_COPY_AND_ASSIGN(FileSystem); 289 DISALLOW_COPY_AND_ASSIGN(FileSystem);
304 }; 290 };
305 291
306 } // namespace drive 292 } // namespace drive
307 293
308 #endif // CHROME_BROWSER_CHROMEOS_DRIVE_FILE_SYSTEM_H_ 294 #endif // CHROME_BROWSER_CHROMEOS_DRIVE_FILE_SYSTEM_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698