| 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/update_check_action.h" | 5 #include "update_engine/update_check_action.h" |
| 6 #include <inttypes.h> | 6 #include <inttypes.h> |
| 7 #include <sstream> | 7 #include <sstream> |
| 8 | 8 |
| 9 #include <libxml/parser.h> | 9 #include <libxml/parser.h> |
| 10 #include <libxml/xpath.h> | 10 #include <libxml/xpath.h> |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 67 "updaterversion=\"" + XmlEncode(kGupdateVersion) + "\" " | 67 "updaterversion=\"" + XmlEncode(kGupdateVersion) + "\" " |
| 68 "protocol=\"2.0\" " | 68 "protocol=\"2.0\" " |
| 69 "machineid=\"") + XmlEncode(params.machine_id) + "\" ismachine=\"1\" " | 69 "machineid=\"") + XmlEncode(params.machine_id) + "\" ismachine=\"1\" " |
| 70 "userid=\"" + XmlEncode(params.user_id) + "\">\n" | 70 "userid=\"" + XmlEncode(params.user_id) + "\">\n" |
| 71 " <o:os version=\"" + XmlEncode(params.os_version) + "\" platform=\"" + | 71 " <o:os version=\"" + XmlEncode(params.os_version) + "\" platform=\"" + |
| 72 XmlEncode(params.os_platform) + "\" sp=\"" + | 72 XmlEncode(params.os_platform) + "\" sp=\"" + |
| 73 XmlEncode(params.os_sp) + "\"></o:os>\n" | 73 XmlEncode(params.os_sp) + "\"></o:os>\n" |
| 74 " <o:app appid=\"" + XmlEncode(params.app_id) + "\" version=\"" + | 74 " <o:app appid=\"" + XmlEncode(params.app_id) + "\" version=\"" + |
| 75 XmlEncode(params.app_version) + "\" " | 75 XmlEncode(params.app_version) + "\" " |
| 76 "lang=\"" + XmlEncode(params.app_lang) + "\" track=\"" + | 76 "lang=\"" + XmlEncode(params.app_lang) + "\" track=\"" + |
| 77 XmlEncode(params.app_track) + "\">\n" | 77 XmlEncode(params.app_track) + "\" board=\"" + |
| 78 XmlEncode(params.os_board) + "\">\n" |
| 78 " <o:ping active=\"0\"></o:ping>\n" | 79 " <o:ping active=\"0\"></o:ping>\n" |
| 79 " <o:updatecheck></o:updatecheck>\n" | 80 " <o:updatecheck></o:updatecheck>\n" |
| 80 " </o:app>\n" | 81 " </o:app>\n" |
| 81 "</o:gupdate>\n"; | 82 "</o:gupdate>\n"; |
| 82 } | 83 } |
| 83 } // namespace {} | 84 } // namespace {} |
| 84 | 85 |
| 85 // Encodes XML entities in a given string with libxml2. input must be | 86 // Encodes XML entities in a given string with libxml2. input must be |
| 86 // UTF-8 formatted. Output will be UTF-8 formatted. | 87 // UTF-8 formatted. Output will be UTF-8 formatted. |
| 87 string XmlEncode(const string& input) { | 88 string XmlEncode(const string& input) { |
| (...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 265 output_object.hash = XmlGetProperty(updatecheck_node, "hash"); | 266 output_object.hash = XmlGetProperty(updatecheck_node, "hash"); |
| 266 output_object.size = ParseInt(XmlGetProperty(updatecheck_node, "size")); | 267 output_object.size = ParseInt(XmlGetProperty(updatecheck_node, "size")); |
| 267 output_object.needs_admin = | 268 output_object.needs_admin = |
| 268 XmlGetProperty(updatecheck_node, "needsadmin") == "true"; | 269 XmlGetProperty(updatecheck_node, "needsadmin") == "true"; |
| 269 output_object.prompt = XmlGetProperty(updatecheck_node, "Prompt") == "true"; | 270 output_object.prompt = XmlGetProperty(updatecheck_node, "Prompt") == "true"; |
| 270 SetOutputObject(output_object); | 271 SetOutputObject(output_object); |
| 271 return; | 272 return; |
| 272 } | 273 } |
| 273 | 274 |
| 274 }; // namespace chromeos_update_engine | 275 }; // namespace chromeos_update_engine |
| OLD | NEW |