#ifndef CHROME_BROWSER_SYNC_FILE_SYSTEM_DRIVE_BACKEND_SYNC_TASK_H_
#define CHROME_BROWSER_SYNC_FILE_SYSTEM_DRIVE_BACKEND_SYNC_TASK_H_
#include "base/memory/scoped_ptr.h"
#include "base/memory/weak_ptr.h"
#include "chrome/browser/sync_file_system/sync_callbacks.h"
namespace sync_file_system {
namespace drive_backend {
class SyncTaskToken;
class SyncTask {
public:
SyncTask() : used_network_(false) {}
virtual ~SyncTask() {}
virtual void RunPreflight(scoped_ptr<SyncTaskToken> token) = 0;
bool used_network() { return used_network_; }
protected:
void set_used_network(bool used_network) {
used_network_ = used_network;
}
private:
bool used_network_;
DISALLOW_COPY_AND_ASSIGN(SyncTask);
};
class ExclusiveTask : public SyncTask {
public:
ExclusiveTask();
virtual ~ExclusiveTask();
virtual void RunPreflight(scoped_ptr<SyncTaskToken> token) OVERRIDE FINAL;
virtual void RunExclusive(const SyncStatusCallback& callback) = 0;
private:
base::WeakPtrFactory<ExclusiveTask> weak_ptr_factory_;
DISALLOW_COPY_AND_ASSIGN(ExclusiveTask);
};
}
}
#endif