OLD | NEW |
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 #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 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
111 "version=\"" + XmlEncode(kGupdateVersion) + "\" " | 111 "version=\"" + XmlEncode(kGupdateVersion) + "\" " |
112 "updaterversion=\"" + XmlEncode(kGupdateVersion) + "\" " | 112 "updaterversion=\"" + XmlEncode(kGupdateVersion) + "\" " |
113 "protocol=\"2.0\" ismachine=\"1\">\n" | 113 "protocol=\"2.0\" ismachine=\"1\">\n" |
114 " <o:os version=\"" + XmlEncode(params.os_version) + "\" platform=\"" + | 114 " <o:os version=\"" + XmlEncode(params.os_version) + "\" platform=\"" + |
115 XmlEncode(params.os_platform) + "\" sp=\"" + | 115 XmlEncode(params.os_platform) + "\" sp=\"" + |
116 XmlEncode(params.os_sp) + "\"></o:os>\n" | 116 XmlEncode(params.os_sp) + "\"></o:os>\n" |
117 " <o:app appid=\"" + XmlEncode(params.app_id) + "\" version=\"" + | 117 " <o:app appid=\"" + XmlEncode(params.app_id) + "\" version=\"" + |
118 XmlEncode(params.app_version) + "\" " | 118 XmlEncode(params.app_version) + "\" " |
119 "lang=\"" + XmlEncode(params.app_lang) + "\" track=\"" + | 119 "lang=\"" + XmlEncode(params.app_lang) + "\" track=\"" + |
120 XmlEncode(params.app_track) + "\" board=\"" + | 120 XmlEncode(params.app_track) + "\" board=\"" + |
121 XmlEncode(params.os_board) + "\" delta_okay=\"" + | 121 XmlEncode(params.os_board) + "\" hardware_class=\"" + |
| 122 XmlEncode(params.hardware_class) + "\" delta_okay=\"" + |
122 (params.delta_okay ? "true" : "false") + "\">\n" + body + | 123 (params.delta_okay ? "true" : "false") + "\">\n" + body + |
123 " </o:app>\n" | 124 " </o:app>\n" |
124 "</o:gupdate>\n"; | 125 "</o:gupdate>\n"; |
125 } | 126 } |
126 | 127 |
127 } // namespace {} | 128 } // namespace {} |
128 | 129 |
129 // Encodes XML entities in a given string with libxml2. input must be | 130 // Encodes XML entities in a given string with libxml2. input must be |
130 // UTF-8 formatted. Output will be UTF-8 formatted. | 131 // UTF-8 formatted. Output will be UTF-8 formatted. |
131 string XmlEncode(const string& input) { | 132 string XmlEncode(const string& input) { |
(...skipping 272 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
404 output_object.needs_admin = | 405 output_object.needs_admin = |
405 XmlGetProperty(updatecheck_node, "needsadmin") == "true"; | 406 XmlGetProperty(updatecheck_node, "needsadmin") == "true"; |
406 output_object.prompt = XmlGetProperty(updatecheck_node, "Prompt") == "true"; | 407 output_object.prompt = XmlGetProperty(updatecheck_node, "Prompt") == "true"; |
407 output_object.is_delta = | 408 output_object.is_delta = |
408 XmlGetProperty(updatecheck_node, "IsDelta") == "true"; | 409 XmlGetProperty(updatecheck_node, "IsDelta") == "true"; |
409 SetOutputObject(output_object); | 410 SetOutputObject(output_object); |
410 return; | 411 return; |
411 } | 412 } |
412 | 413 |
413 }; // namespace chromeos_update_engine | 414 }; // namespace chromeos_update_engine |
OLD | NEW |