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

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

Issue 10834415: gdata: Remove unnecessary callback function OnTransferRegularFileCompleteForCopy (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 18ed7e2ffa2b871725cedef7f6cba6ca90bb96a4..dd4acd1711b3b7db13dce37c44ae5d8146452e28 100644
--- a/chrome/browser/chromeos/gdata/gdata_file_system.cc
+++ b/chrome/browser/chromeos/gdata/gdata_file_system.cc
@@ -53,17 +53,6 @@ const int kGDataUpdateCheckIntervalInSec = 60;
//================================ Helper functions ============================
-// Invoked upon completion of TransferRegularFile initiated by Copy.
-//
-// |callback| is run on the thread represented by |relay_proxy|.
-void OnTransferRegularFileCompleteForCopy(
- const FileOperationCallback& callback,
- scoped_refptr<base::MessageLoopProxy> relay_proxy,
- GDataFileError error) {
- if (!callback.is_null())
- relay_proxy->PostTask(FROM_HERE, base::Bind(callback, error));
-}
-
// Runs GetFileCallback with pointers dereferenced.
// Used for PostTaskAndReply().
void RunGetFileCallbackHelper(const GetFileCallback& callback,
@@ -1024,22 +1013,9 @@ void GDataFileSystem::OnGetFileCompleteForCopy(
return;
}
- // This callback is only triggered for a regular file via Copy() and runs
- // on the same thread as Copy (IO thread). As TransferRegularFile must run
- // on the UI thread, we thus need to post a task to the UI thread.
- // Also, upon the completion of TransferRegularFile, we need to run |callback|
- // on the same thread as Copy (IO thread), and the transition from UI thread
- // to IO thread is handled by OnTransferRegularFileCompleteForCopy.
+ // This callback is only triggered for a regular file via Copy().
DCHECK_EQ(REGULAR_FILE, file_type);
- BrowserThread::PostTask(
- BrowserThread::UI,
- FROM_HERE,
- base::Bind(&GDataFileSystem::TransferRegularFile,
- ui_weak_ptr_,
- local_file_path, remote_dest_file_path,
- base::Bind(OnTransferRegularFileCompleteForCopy,
- callback,
- base::MessageLoopProxy::current())));
+ TransferRegularFile(local_file_path, remote_dest_file_path, callback);
}
void GDataFileSystem::OnGetFileCompleteForTransferFile(
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698