#ifndef CHROME_BROWSER_SYNC_FILE_SYSTEM_DRIVE_BACKEND_TASK_DEPENDENCY_MANAGER_H_
#define CHROME_BROWSER_SYNC_FILE_SYSTEM_DRIVE_BACKEND_TASK_DEPENDENCY_MANAGER_H_
#include <map>
#include <set>
#include <string>
#include <vector>
#include "base/files/file_path.h"
#include "base/memory/scoped_ptr.h"
#include "chrome/browser/sync_file_system/subtree_set.h"
namespace sync_file_system {
namespace drive_backend {
struct BlockingFactor {
bool exclusive;
std::string app_id;
std::vector<base::FilePath> paths;
std::vector<std::string> file_ids;
std::vector<int64> tracker_ids;
BlockingFactor();
~BlockingFactor();
};
class TaskDependencyManager {
public:
TaskDependencyManager();
~TaskDependencyManager();
bool Insert(const BlockingFactor& blocking_factor);
void Erase(const BlockingFactor& blocking_factor);
private:
friend class TaskDependencyManagerTest;
bool running_exclusive_task_;
std::map<std::string, SubtreeSet> paths_by_app_id_;
std::set<std::string> file_ids_;
std::set<int64> tracker_ids_;
DISALLOW_COPY_AND_ASSIGN(TaskDependencyManager);
};
}
}
#endif