Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(209)

Unified Diff: update_attempter.cc

Issue 3259011: AU: Start an UpdateAttempter unit test suite. (Closed) Base URL: ssh://git@gitrw.chromium.org:9222/update_engine.git
Patch Set: Created 10 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « update_attempter.h ('k') | update_attempter_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: update_attempter.cc
diff --git a/update_attempter.cc b/update_attempter.cc
index 3614cad06c6466bec87914106bc4d1a760ff5c4a..694e7748178669f609c1db5d1fdebf9f8a764a81 100644
--- a/update_attempter.cc
+++ b/update_attempter.cc
@@ -87,7 +87,8 @@ ActionExitCode GetErrorCodeForAction(AbstractAction* action,
UpdateAttempter::UpdateAttempter(PrefsInterface* prefs,
MetricsLibraryInterface* metrics_lib)
- : dbus_service_(NULL),
+ : processor_(new ActionProcessor()),
+ dbus_service_(NULL),
prefs_(prefs),
metrics_lib_(metrics_lib),
update_check_scheduler_(NULL),
@@ -124,8 +125,8 @@ void UpdateAttempter::Update(const std::string& app_version,
LOG(ERROR) << "Unable to initialize Omaha request device params.";
return;
}
- CHECK(!processor_.IsRunning());
- processor_.set_delegate(this);
+ CHECK(!processor_->IsRunning());
+ processor_->set_delegate(this);
// Actions:
shared_ptr<OmahaRequestAction> update_check_action(
@@ -186,7 +187,7 @@ void UpdateAttempter::Update(const std::string& app_version,
// Enqueue the actions
for (vector<shared_ptr<AbstractAction> >::iterator it = actions_.begin();
it != actions_.end(); ++it) {
- processor_.EnqueueAction(it->get());
+ processor_->EnqueueAction(it->get());
}
// Bond them together. We have to use the leaf-types when calling
@@ -207,7 +208,7 @@ void UpdateAttempter::Update(const std::string& app_version,
postinstall_runner_action_postcommit.get());
SetStatusAndNotify(UPDATE_STATUS_CHECKING_FOR_UPDATE);
- processor_.StartProcessing();
+ processor_->StartProcessing();
}
void UpdateAttempter::CheckForUpdate(const std::string& app_version,
@@ -426,9 +427,9 @@ bool UpdateAttempter::ScheduleErrorEventAction() {
error_event_.release(), // Pass ownership.
new LibcurlHttpFetcher));
actions_.push_back(shared_ptr<AbstractAction>(error_event_action));
- processor_.EnqueueAction(error_event_action.get());
+ processor_->EnqueueAction(error_event_action.get());
SetStatusAndNotify(UPDATE_STATUS_REPORTING_ERROR_EVENT);
- processor_.StartProcessing();
+ processor_->StartProcessing();
return true;
}
« no previous file with comments | « update_attempter.h ('k') | update_attempter_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698