This source file includes following definitions.
- CallRunExclusive
- RunPreflight
#include "chrome/browser/sync_file_system/drive_backend/sync_task.h"
#include "base/bind.h"
#include "chrome/browser/sync_file_system/drive_backend/sync_task_manager.h"
#include "chrome/browser/sync_file_system/drive_backend/sync_task_token.h"
#include "chrome/browser/sync_file_system/drive_backend/task_dependency_manager.h"
namespace sync_file_system {
namespace drive_backend {
namespace {
void CallRunExclusive(const base::WeakPtr<ExclusiveTask>& task,
scoped_ptr<SyncTaskToken> token) {
if (task)
task->RunExclusive(SyncTaskToken::WrapToCallback(token.Pass()));
}
}
ExclusiveTask::ExclusiveTask() : weak_ptr_factory_(this) {}
ExclusiveTask::~ExclusiveTask() {}
void ExclusiveTask::RunPreflight(scoped_ptr<SyncTaskToken> token) {
scoped_ptr<BlockingFactor> blocking_factor(new BlockingFactor);
blocking_factor->exclusive = true;
SyncTaskManager::MoveTaskToBackground(
token.Pass(), blocking_factor.Pass(),
base::Bind(&CallRunExclusive, weak_ptr_factory_.GetWeakPtr()));
}
}
}