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

Unified Diff: chrome/browser/chromeos/gdata/gdata_file_system_proxy.cc

Issue 10543037: gdata: Convert public synchronous functions in GDataFileSystem to asynchronous. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address Toni's comments @ 06/08/12 10:59AM PDT. Created 8 years, 6 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
« no previous file with comments | « chrome/browser/chromeos/gdata/gdata_file_system_proxy.h ('k') | chrome/browser/chromeos/gdata/gdata_util.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chromeos/gdata/gdata_file_system_proxy.cc
diff --git a/chrome/browser/chromeos/gdata/gdata_file_system_proxy.cc b/chrome/browser/chromeos/gdata/gdata_file_system_proxy.cc
index decfef425292a52640d491321055e7c043930f59..ec3548607ebfdf492f7d7aae5b48858788e2465b 100644
--- a/chrome/browser/chromeos/gdata/gdata_file_system_proxy.cc
+++ b/chrome/browser/chromeos/gdata/gdata_file_system_proxy.cc
@@ -215,10 +215,7 @@ void GDataFileSystemProxy::CreateSnapshotFile(
const GURL& file_url,
const FileSystemOperationInterface::SnapshotFileCallback& callback) {
FilePath file_path;
- base::PlatformFileInfo file_info;
- GDataFileProperties file_properties;
- if (!ValidateUrl(file_url, &file_path) ||
- !file_system_->GetFileInfoByPath(file_path, &file_properties)) {
+ if (!ValidateUrl(file_url, &file_path)) {
MessageLoopProxy::current()->PostTask(FROM_HERE,
base::Bind(callback,
base::PLATFORM_FILE_ERROR_NOT_FOUND,
@@ -228,10 +225,36 @@ void GDataFileSystemProxy::CreateSnapshotFile(
return;
}
- file_system_->GetFileByPath(file_path,
+ file_system_->GetEntryInfoByPathAsync(
+ file_path,
+ base::Bind(&GDataFileSystemProxy::OnGetEntryInfoByPathAsync,
+ this, callback));
+}
+
+void GDataFileSystemProxy::OnGetEntryInfoByPathAsync(
+ const FileSystemOperationInterface::SnapshotFileCallback& callback,
+ base::PlatformFileError error,
+ const FilePath& entry_path,
+ scoped_ptr<GDataEntryProto> entry_proto) {
+ if (error != base::PLATFORM_FILE_OK || !entry_proto.get()) {
+ MessageLoopProxy::current()->PostTask(FROM_HERE,
+ base::Bind(callback,
+ base::PLATFORM_FILE_ERROR_NOT_FOUND,
+ base::PlatformFileInfo(),
+ FilePath(),
+ scoped_refptr<ShareableFileReference>(NULL)));
+ return;
+ }
+
+ base::PlatformFileInfo file_info;
+ GDataEntry::ConvertProtoToPlatformFileInfo(
+ entry_proto->file_info(),
+ &file_info);
+
+ file_system_->GetFileByPath(entry_path,
base::Bind(&CallSnapshotFileCallback,
callback,
- file_properties.file_info),
+ file_info),
GetDownloadDataCallback());
}
« no previous file with comments | « chrome/browser/chromeos/gdata/gdata_file_system_proxy.h ('k') | chrome/browser/chromeos/gdata/gdata_util.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698