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

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

Issue 10834170: gdata: Move GDataWapiFeedLoader to a set of new files (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: add missing files... 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
Index: chrome/browser/chromeos/gdata/gdata_util.cc
diff --git a/chrome/browser/chromeos/gdata/gdata_util.cc b/chrome/browser/chromeos/gdata/gdata_util.cc
index 3db16702ec620677e710e2d508326b9174c7fc2f..92a3c785e143cbe93793d74bba2048119cee3dc7 100644
--- a/chrome/browser/chromeos/gdata/gdata_util.cc
+++ b/chrome/browser/chromeos/gdata/gdata_util.cc
@@ -21,6 +21,7 @@
#include "base/stringprintf.h"
#include "base/threading/sequenced_worker_pool.h"
#include "base/time.h"
+#include "base/tracked_objects.h"
#include "chrome/browser/chromeos/gdata/file_write_helper.h"
#include "chrome/browser/chromeos/gdata/gdata.pb.h"
#include "chrome/browser/chromeos/gdata/gdata_file_system_interface.h"
@@ -604,5 +605,47 @@ void PrepareWritableFileAndRun(Profile* profile,
}
}
+GDataFileError GDataToGDataFileError(GDataErrorCode status) {
+ switch (status) {
+ case HTTP_SUCCESS:
+ case HTTP_CREATED:
+ return GDATA_FILE_OK;
+ case HTTP_UNAUTHORIZED:
+ case HTTP_FORBIDDEN:
+ return GDATA_FILE_ERROR_ACCESS_DENIED;
+ case HTTP_NOT_FOUND:
+ return GDATA_FILE_ERROR_NOT_FOUND;
+ case GDATA_PARSE_ERROR:
+ case GDATA_FILE_ERROR:
+ return GDATA_FILE_ERROR_ABORT;
+ case GDATA_NO_CONNECTION:
+ return GDATA_FILE_ERROR_NO_CONNECTION;
+ default:
+ return GDATA_FILE_ERROR_FAILED;
+ }
+}
+
+void PostBlockingPoolSequencedTask(
+ const tracked_objects::Location& from_here,
+ base::SequencedTaskRunner* blocking_task_runner,
+ const base::Closure& task) {
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+
+ const bool posted = blocking_task_runner->PostTask(from_here, task);
+ DCHECK(posted);
+}
+
+void PostBlockingPoolSequencedTaskAndReply(
+ const tracked_objects::Location& from_here,
+ base::SequencedTaskRunner* blocking_task_runner,
+ const base::Closure& request_task,
+ const base::Closure& reply_task) {
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+
+ const bool posted = blocking_task_runner->PostTaskAndReply(
+ from_here, request_task, reply_task);
+ DCHECK(posted);
+}
+
} // namespace util
} // namespace gdata

Powered by Google App Engine
This is Rietveld 408576698