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

Side by Side Diff: omaha_response_handler_action.cc

Issue 3620013: AU: Resume interrupted update attempts. (Closed) Base URL: ssh://git@gitrw.chromium.org:9222/update_engine.git
Patch Set: fix setup download Created 10 years, 2 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « multi_http_fetcher.h ('k') | update_attempter.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2010 The Chromium OS Authors. All rights reserved. 1 // Copyright (c) 2010 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/omaha_response_handler_action.h" 5 #include "update_engine/omaha_response_handler_action.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include <base/logging.h> 9 #include <base/logging.h>
10 10
(...skipping 14 matching lines...) Expand all
25 LOG(INFO) << "There are no updates. Aborting."; 25 LOG(INFO) << "There are no updates. Aborting.";
26 return; 26 return;
27 } 27 }
28 install_plan_.download_url = response.codebase; 28 install_plan_.download_url = response.codebase;
29 install_plan_.size = response.size; 29 install_plan_.size = response.size;
30 install_plan_.download_hash = response.hash; 30 install_plan_.download_hash = response.hash;
31 31
32 install_plan_.is_resume = 32 install_plan_.is_resume =
33 DeltaPerformer::CanResumeUpdate(prefs_, response.hash); 33 DeltaPerformer::CanResumeUpdate(prefs_, response.hash);
34 if (!install_plan_.is_resume) { 34 if (!install_plan_.is_resume) {
35 LOG_IF(WARNING, !DeltaPerformer::ResetUpdateProgress(prefs_)) 35 LOG_IF(WARNING, !DeltaPerformer::ResetUpdateProgress(prefs_, false))
36 << "Unable to reset the update progress."; 36 << "Unable to reset the update progress.";
37 LOG_IF(WARNING, !prefs_->SetString(kPrefsUpdateCheckResponseHash, 37 LOG_IF(WARNING, !prefs_->SetString(kPrefsUpdateCheckResponseHash,
38 response.hash)) 38 response.hash))
39 << "Unable to save the update check response hash."; 39 << "Unable to save the update check response hash.";
40 } 40 }
41 41
42 TEST_AND_RETURN(GetInstallDev( 42 TEST_AND_RETURN(GetInstallDev(
43 (!boot_device_.empty() ? boot_device_ : utils::BootDevice()), 43 (!boot_device_.empty() ? boot_device_ : utils::BootDevice()),
44 &install_plan_.install_path)); 44 &install_plan_.install_path));
45 install_plan_.kernel_install_path = 45 install_plan_.kernel_install_path =
(...skipping 16 matching lines...) Expand all
62 string ret(boot_dev); 62 string ret(boot_dev);
63 string::reverse_iterator it = ret.rbegin(); // last character in string 63 string::reverse_iterator it = ret.rbegin(); // last character in string
64 // Right now, we just switch '3' and '5' partition numbers. 64 // Right now, we just switch '3' and '5' partition numbers.
65 TEST_AND_RETURN_FALSE((*it == '3') || (*it == '5')); 65 TEST_AND_RETURN_FALSE((*it == '3') || (*it == '5'));
66 *it = (*it == '3') ? '5' : '3'; 66 *it = (*it == '3') ? '5' : '3';
67 *install_dev = ret; 67 *install_dev = ret;
68 return true; 68 return true;
69 } 69 }
70 70
71 } // namespace chromeos_update_engine 71 } // namespace chromeos_update_engine
OLDNEW
« no previous file with comments | « multi_http_fetcher.h ('k') | update_attempter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698