Initial implementation of sending an install success event to Omaha.
BUG=560
TEST=emerged,ran unit tests
Review URL: http://codereview.chromium.org/2981008
diff --git a/update_attempter.cc b/update_attempter.cc
index a8a3207..f034b0b 100644
--- a/update_attempter.cc
+++ b/update_attempter.cc
@@ -100,10 +100,10 @@
processor_.set_delegate(this);
// Actions:
- shared_ptr<OmahaRequestPrepAction> request_prep_action(
+ shared_ptr<OmahaRequestPrepAction> update_check_prep_action(
new OmahaRequestPrepAction(force_full_update));
shared_ptr<OmahaRequestAction> update_check_action(
- new OmahaRequestAction(new LibcurlHttpFetcher));
+ new OmahaRequestAction(NULL, new LibcurlHttpFetcher));
shared_ptr<OmahaResponseHandlerAction> response_handler_action(
new OmahaResponseHandlerAction);
shared_ptr<FilesystemCopierAction> filesystem_copier_action(
@@ -118,11 +118,18 @@
new SetBootableFlagAction);
shared_ptr<PostinstallRunnerAction> postinstall_runner_action_postcommit(
new PostinstallRunnerAction(false));
+ shared_ptr<OmahaRequestPrepAction> install_success_prep_action(
+ new OmahaRequestPrepAction(false));
+ shared_ptr<OmahaRequestAction> install_success_action(
+ new OmahaRequestAction(new OmahaEvent(OmahaEvent::kTypeInstallComplete,
+ OmahaEvent::kResultSuccess,
+ 0),
+ new LibcurlHttpFetcher));
download_action->set_delegate(this);
response_handler_action_ = response_handler_action;
- actions_.push_back(shared_ptr<AbstractAction>(request_prep_action));
+ actions_.push_back(shared_ptr<AbstractAction>(update_check_prep_action));
actions_.push_back(shared_ptr<AbstractAction>(update_check_action));
actions_.push_back(shared_ptr<AbstractAction>(response_handler_action));
actions_.push_back(shared_ptr<AbstractAction>(filesystem_copier_action));
@@ -134,6 +141,8 @@
actions_.push_back(shared_ptr<AbstractAction>(set_bootable_flag_action));
actions_.push_back(shared_ptr<AbstractAction>(
postinstall_runner_action_postcommit));
+ actions_.push_back(shared_ptr<AbstractAction>(install_success_prep_action));
+ actions_.push_back(shared_ptr<AbstractAction>(install_success_action));
// Enqueue the actions
for (vector<shared_ptr<AbstractAction> >::iterator it = actions_.begin();
@@ -143,7 +152,7 @@
// Bond them together. We have to use the leaf-types when calling
// BondActions().
- BondActions(request_prep_action.get(),
+ BondActions(update_check_prep_action.get(),
update_check_action.get());
BondActions(update_check_action.get(),
response_handler_action.get());
@@ -159,6 +168,8 @@
set_bootable_flag_action.get());
BondActions(set_bootable_flag_action.get(),
postinstall_runner_action_postcommit.get());
+ BondActions(install_success_prep_action.get(),
+ install_success_action.get());
SetStatusAndNotify(UPDATE_STATUS_CHECKING_FOR_UPDATE);
processor_.StartProcessing();