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

Side by Side Diff: src/platform/update_engine/action_processor.cc

Issue 492008: AU: Try delta updates first, then full updates (Closed)
Patch Set: use mkstemp Created 11 years 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 unified diff | Download patch
OLDNEW
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
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
OLDNEW
« no previous file with comments | « src/platform/update_engine/action_processor.h ('k') | src/platform/update_engine/action_processor_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698