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

Unified Diff: chrome/browser/chromeos/drive/drive_scheduler.cc

Issue 11280140: Pass calls to GetApplicationInfo through the scheduler (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix unit test Created 8 years 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/drive/drive_scheduler.cc
diff --git a/chrome/browser/chromeos/drive/drive_scheduler.cc b/chrome/browser/chromeos/drive/drive_scheduler.cc
index aa91c183dff62db718191fd7ad388815e379c29c..aece2643a930a28b6968b61d9a5de1416a81bd82 100644
--- a/chrome/browser/chromeos/drive/drive_scheduler.cc
+++ b/chrome/browser/chromeos/drive/drive_scheduler.cc
@@ -76,6 +76,19 @@ void DriveScheduler::Initialize() {
initialized_ = true;
}
+void DriveScheduler::GetApplicationInfo(
+ const google_apis::GetDataCallback& callback) {
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+
+ scoped_ptr<QueueEntry> new_job(
+ new QueueEntry(TYPE_GET_APPLICATION_INFO, FilePath()));
+ new_job->get_data_callback = callback;
+
+ QueueJob(new_job.Pass());
+
+ StartJobLoop();
+}
+
void DriveScheduler::Copy(const FilePath& src_file_path,
const FilePath& dest_file_path,
const FileOperationCallback& callback) {
@@ -233,6 +246,14 @@ void DriveScheduler::DoJobLoop() {
const QueueEntry* queue_entry = job_iter->second.get();
switch (job_info.job_type) {
+ case TYPE_GET_APPLICATION_INFO: {
+ drive_service_->GetApplicationInfo(
+ base::Bind(&DriveScheduler::OnGetDataJobDone,
+ weak_ptr_factory_.GetWeakPtr(),
+ job_id));
+ }
+ break;
+
case TYPE_COPY: {
drive_operations_->Copy(
job_info.file_path,
« no previous file with comments | « chrome/browser/chromeos/drive/drive_scheduler.h ('k') | chrome/browser/chromeos/drive/drive_scheduler_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698