| Index: chrome/browser/chromeos/gdata/gdata_file_system.cc
|
| diff --git a/chrome/browser/chromeos/gdata/gdata_file_system.cc b/chrome/browser/chromeos/gdata/gdata_file_system.cc
|
| index e2824acb99791eada3c0e54ecf17ee89ec6899f5..18eae5de1d87487ce19e7264c9841371d9dcfcc0 100644
|
| --- a/chrome/browser/chromeos/gdata/gdata_file_system.cc
|
| +++ b/chrome/browser/chromeos/gdata/gdata_file_system.cc
|
| @@ -1888,6 +1888,8 @@ void GDataFileSystem::InitiateUpload(
|
| const FilePath& destination_directory,
|
| const FilePath& virtual_path,
|
| const InitiateUploadCallback& callback) {
|
| + DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
|
| +
|
| GURL destination_directory_url =
|
| GetUploadUrlForDirectory(destination_directory);
|
|
|
| @@ -1902,52 +1904,20 @@ void GDataFileSystem::InitiateUpload(
|
| }
|
|
|
| documents_service_->InitiateUpload(
|
| - InitiateUploadParams(file_name,
|
| - content_type,
|
| - content_length,
|
| - destination_directory_url,
|
| - virtual_path),
|
| - base::Bind(&GDataFileSystem::OnUploadLocationReceived,
|
| - GetWeakPtrForCurrentThread(),
|
| - callback,
|
| - // MessageLoopProxy is used to run |callback| on the
|
| - // thread where this function was called.
|
| - base::MessageLoopProxy::current()));
|
| -}
|
| -
|
| -void GDataFileSystem::OnUploadLocationReceived(
|
| - const InitiateUploadCallback& callback,
|
| - scoped_refptr<base::MessageLoopProxy> message_loop_proxy,
|
| - GDataErrorCode code,
|
| - const GURL& upload_location) {
|
| -
|
| - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
|
| - if (!callback.is_null()) {
|
| - message_loop_proxy->PostTask(FROM_HERE, base::Bind(callback, code,
|
| - upload_location));
|
| - }
|
| + InitiateUploadParams(file_name,
|
| + content_type,
|
| + content_length,
|
| + destination_directory_url,
|
| + virtual_path),
|
| + callback);
|
| }
|
|
|
| void GDataFileSystem::ResumeUpload(
|
| const ResumeUploadParams& params,
|
| const ResumeFileUploadCallback& callback) {
|
| - documents_service_->ResumeUpload(
|
| - params,
|
| - base::Bind(&GDataFileSystem::OnResumeUpload,
|
| - GetWeakPtrForCurrentThread(),
|
| - base::MessageLoopProxy::current(),
|
| - callback));
|
| -}
|
| -
|
| -void GDataFileSystem::OnResumeUpload(
|
| - scoped_refptr<base::MessageLoopProxy> message_loop_proxy,
|
| - const ResumeFileUploadCallback& callback,
|
| - const ResumeUploadResponse& response,
|
| - scoped_ptr<DocumentEntry> new_entry) {
|
| DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
|
| - if (!callback.is_null())
|
| - message_loop_proxy->PostTask(FROM_HERE,
|
| - base::Bind(callback, response, base::Passed(&new_entry)));
|
| +
|
| + documents_service_->ResumeUpload(params, callback);
|
| }
|
|
|
| void GDataFileSystem::UnsafeFindEntryByPath(
|
|
|