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

Side by Side Diff: omaha_request_action.cc

Issue 6253002: AU: XmlEncode the previous version, just in case. (Closed) Base URL: ssh://git@gitrw.chromium.org:9222/update_engine.git@master
Patch Set: Created 9 years, 11 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 | « no previous file | omaha_request_action_unittest.cc » ('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_request_action.h" 5 #include "update_engine/omaha_request_action.h"
6 6
7 #include <inttypes.h> 7 #include <inttypes.h>
8 8
9 #include <sstream> 9 #include <sstream>
10 10
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
107 string prev_version; 107 string prev_version;
108 if (!prefs->GetString(kPrefsPreviousVersion, &prev_version)) { 108 if (!prefs->GetString(kPrefsPreviousVersion, &prev_version)) {
109 prev_version = "0.0.0.0"; 109 prev_version = "0.0.0.0";
110 } 110 }
111 if (!prev_version.empty()) { 111 if (!prev_version.empty()) {
112 body += StringPrintf( 112 body += StringPrintf(
113 " <o:event eventtype=\"%d\" eventresult=\"%d\" " 113 " <o:event eventtype=\"%d\" eventresult=\"%d\" "
114 "previousversion=\"%s\"></o:event>\n", 114 "previousversion=\"%s\"></o:event>\n",
115 OmahaEvent::kTypeUpdateComplete, 115 OmahaEvent::kTypeUpdateComplete,
116 OmahaEvent::kResultSuccessReboot, 116 OmahaEvent::kResultSuccessReboot,
117 prev_version.c_str()); 117 XmlEncode(prev_version).c_str());
118 LOG_IF(WARNING, !prefs->SetString(kPrefsPreviousVersion, "")) 118 LOG_IF(WARNING, !prefs->SetString(kPrefsPreviousVersion, ""))
119 << "Unable to reset the previous version."; 119 << "Unable to reset the previous version.";
120 } 120 }
121 } else { 121 } else {
122 // The error code is an optional attribute so append it only if the result 122 // The error code is an optional attribute so append it only if the result
123 // is not success. 123 // is not success.
124 string error_code; 124 string error_code;
125 if (event->result != OmahaEvent::kResultSuccess) { 125 if (event->result != OmahaEvent::kResultSuccess) {
126 int code = event->error_code; 126 int code = event->error_code;
127 if (!utils::IsNormalBootMode()) { 127 if (!utils::IsNormalBootMode()) {
(...skipping 325 matching lines...) Expand 10 before | Expand all | Expand 10 after
453 output_object.needs_admin = 453 output_object.needs_admin =
454 XmlGetProperty(updatecheck_node, "needsadmin") == "true"; 454 XmlGetProperty(updatecheck_node, "needsadmin") == "true";
455 output_object.prompt = XmlGetProperty(updatecheck_node, "Prompt") == "true"; 455 output_object.prompt = XmlGetProperty(updatecheck_node, "Prompt") == "true";
456 output_object.is_delta = 456 output_object.is_delta =
457 XmlGetProperty(updatecheck_node, "IsDelta") == "true"; 457 XmlGetProperty(updatecheck_node, "IsDelta") == "true";
458 output_object.deadline = XmlGetProperty(updatecheck_node, "deadline"); 458 output_object.deadline = XmlGetProperty(updatecheck_node, "deadline");
459 SetOutputObject(output_object); 459 SetOutputObject(output_object);
460 } 460 }
461 461
462 }; // namespace chromeos_update_engine 462 }; // namespace chromeos_update_engine
OLDNEW
« no previous file with comments | « no previous file | omaha_request_action_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698