This source file includes following definitions.
- Do
- Rollback
- ShouldRun
- ShouldRun
#include "chrome/installer/util/conditional_work_item_list.h"
#include "base/file_util.h"
#include "base/logging.h"
ConditionalWorkItemList::ConditionalWorkItemList(Condition* condition)
: condition_(condition) {
}
ConditionalWorkItemList::~ConditionalWorkItemList() {}
bool ConditionalWorkItemList::Do() {
VLOG(1) << "Evaluating " << log_message_ << " condition...";
if (condition_.get() && condition_->ShouldRun()) {
VLOG(1) << "Beginning conditional work item list";
return WorkItemList::Do();
}
VLOG(1) << "No work to do in condition work item list "
<< log_message_;
return true;
}
void ConditionalWorkItemList::Rollback() {
VLOG(1) << "Rolling back conditional list " << log_message_;
WorkItemList::Rollback();
}
bool ConditionRunIfFileExists::ShouldRun() const {
return base::PathExists(key_path_);
}
bool Not::ShouldRun() const {
return !original_condition_->ShouldRun();
}