7 #ifndef PACKAGER_APP_JOB_MANAGER_H_ 8 #define PACKAGER_APP_JOB_MANAGER_H_ 13 #include "packager/base/threading/simple_thread.h" 14 #include "packager/status.h" 24 class Job :
public base::SimpleThread {
26 Job(
const std::string& name, std::shared_ptr<OriginHandler> work);
35 const Status& status()
const {
return status_; }
39 base::WaitableEvent* wait() {
return &wait_; }
43 Job& operator=(
const Job&) =
delete;
47 std::shared_ptr<OriginHandler> work_;
50 base::WaitableEvent wait_;
61 explicit JobManager(std::unique_ptr<SyncPointQueue> sync_points);
66 void Add(
const std::string& name, std::shared_ptr<OriginHandler> handler);
90 std::shared_ptr<OriginHandler> worker;
93 std::vector<JobEntry> job_entries_;
94 std::vector<std::unique_ptr<Job>> jobs_;
97 std::unique_ptr<SyncPointQueue> sync_points_;
103 #endif // PACKAGER_APP_JOB_MANAGER_H_ All the methods that are virtual are virtual for mocking.