| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium OS Authors. All rights reserved. | 1 // Copyright (c) 2009 The Chromium OS Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "update_engine/action_processor.h" | 5 #include "update_engine/action_processor.h" |
| 6 #include <string> |
| 6 #include "chromeos/obsolete_logging.h" | 7 #include "chromeos/obsolete_logging.h" |
| 7 #include "update_engine/action.h" | 8 #include "update_engine/action.h" |
| 8 | 9 |
| 10 using std::string; |
| 11 |
| 9 namespace chromeos_update_engine { | 12 namespace chromeos_update_engine { |
| 10 | 13 |
| 11 ActionProcessor::ActionProcessor() | 14 ActionProcessor::ActionProcessor() |
| 12 : current_action_(NULL), delegate_(NULL) {} | 15 : current_action_(NULL), delegate_(NULL) {} |
| 13 | 16 |
| 14 ActionProcessor::~ActionProcessor() { | 17 ActionProcessor::~ActionProcessor() { |
| 15 if (IsRunning()) { | 18 if (IsRunning()) { |
| 16 StopProcessing(); | 19 StopProcessing(); |
| 17 } | 20 } |
| 18 for (std::deque<AbstractAction*>::iterator it = actions_.begin(); | 21 for (std::deque<AbstractAction*>::iterator it = actions_.begin(); |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 63 " type " << old_type; | 66 " type " << old_type; |
| 64 } else if (!success) { | 67 } else if (!success) { |
| 65 LOG(INFO) << "ActionProcessor::ActionComplete: " << old_type | 68 LOG(INFO) << "ActionProcessor::ActionComplete: " << old_type |
| 66 << " action failed. Aborting processing."; | 69 << " action failed. Aborting processing."; |
| 67 actions_.clear(); | 70 actions_.clear(); |
| 68 } | 71 } |
| 69 if (actions_.empty()) { | 72 if (actions_.empty()) { |
| 70 LOG(INFO) << "ActionProcessor::ActionComplete: finished last action of" | 73 LOG(INFO) << "ActionProcessor::ActionComplete: finished last action of" |
| 71 " type " << old_type; | 74 " type " << old_type; |
| 72 if (delegate_) { | 75 if (delegate_) { |
| 73 delegate_->ProcessingDone(this); | 76 delegate_->ProcessingDone(this, success); |
| 74 } | 77 } |
| 75 return; | 78 return; |
| 76 } | 79 } |
| 77 current_action_ = actions_.front(); | 80 current_action_ = actions_.front(); |
| 78 actions_.pop_front(); | 81 actions_.pop_front(); |
| 79 LOG(INFO) << "ActionProcessor::ActionComplete: finished " << old_type | 82 LOG(INFO) << "ActionProcessor::ActionComplete: finished " << old_type |
| 80 << ", starting " << current_action_->Type(); | 83 << ", starting " << current_action_->Type(); |
| 81 current_action_->PerformAction(); | 84 current_action_->PerformAction(); |
| 82 } | 85 } |
| 83 | 86 |
| 84 } // namespace chromeos_update_engine | 87 } // namespace chromeos_update_engine |
| OLD | NEW |