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

Unified Diff: components/drive/drive_api_util.h

Issue 2842493004: Add OnceCallback support to PostTaskAndReplyWithResult (Closed)
Patch Set: s/can not/cannot/ Created 3 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
« no previous file with comments | « components/drive/chromeos/file_system/search_operation.cc ('k') | components/drive/drive_api_util.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/drive/drive_api_util.h
diff --git a/components/drive/drive_api_util.h b/components/drive/drive_api_util.h
index d26c23317bae7dd6401f4782bed3f4fc4bc0d2d5..e56f43b62a2c8d57b317f89d315a2b80e89093d2 100644
--- a/components/drive/drive_api_util.h
+++ b/components/drive/drive_api_util.h
@@ -8,13 +8,20 @@
#include <memory>
#include <string>
+#include "base/callback.h"
#include "base/md5.h"
+#include "components/drive/file_errors.h"
#include "google_apis/drive/drive_api_error_codes.h"
#include "google_apis/drive/drive_common_callbacks.h"
+namespace tracked_objects {
+class Location;
+} // namespace tracked_objects
+
namespace base {
class CancellationFlag;
class FilePath;
+class TaskRunner;
} // namespace base
namespace drive {
@@ -69,6 +76,13 @@ bool IsKnownHostedDocumentMimeType(const std::string& mime_type);
// hosted document types.
bool HasHostedDocumentExtension(const base::FilePath& path);
+// Runs |task| on |task_runner|, then runs |reply| on the original thread with
+// the resulting error code.
+void RunAsyncTask(base::TaskRunner* task_runner,
+ const tracked_objects::Location& from_here,
+ base::OnceCallback<FileError()> task,
+ base::OnceCallback<void(FileError)> reply);
+
} // namespace util
} // namespace drive
« no previous file with comments | « components/drive/chromeos/file_system/search_operation.cc ('k') | components/drive/drive_api_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698