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

Unified Diff: chrome/browser/chromeos/drive/drive_file_system.cc

Issue 14067009: drive: Call LoadIfNeeded before CreateDirectory. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 7 years, 8 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/chromeos/drive/drive_file_system.cc
diff --git a/chrome/browser/chromeos/drive/drive_file_system.cc b/chrome/browser/chromeos/drive/drive_file_system.cc
index ff631f829b687d942ace7b584fe2e54c5bf62797..da7e8d7cb2fb86141aaaaa3ad87de7b52da4ae70 100644
--- a/chrome/browser/chromeos/drive/drive_file_system.cc
+++ b/chrome/browser/chromeos/drive/drive_file_system.cc
@@ -389,6 +389,27 @@ void DriveFileSystem::CreateDirectory(
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
DCHECK(!callback.is_null());
+ change_list_loader_->LoadIfNeeded(
+ DirectoryFetchInfo(),
+ base::Bind(&DriveFileSystem::CreateDirectoryAfterLoad,
+ weak_ptr_factory_.GetWeakPtr(),
+ directory_path, is_exclusive, is_recursive, callback));
+}
+
+void DriveFileSystem::CreateDirectoryAfterLoad(
+ const base::FilePath& directory_path,
+ bool is_exclusive,
+ bool is_recursive,
+ const FileOperationCallback& callback,
+ FileError load_error) {
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK(!callback.is_null());
+
+ if (load_error != FILE_ERROR_OK) {
+ callback.Run(load_error);
+ return;
+ }
+
drive_operations_.CreateDirectory(
directory_path, is_exclusive, is_recursive, callback);
}
« no previous file with comments | « chrome/browser/chromeos/drive/drive_file_system.h ('k') | chrome/browser/chromeos/drive/drive_file_system_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698