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

Side by Side Diff: omaha_request_action.cc

Issue 3007020: Add a hardware_class attribute (for HWID, HWQual ID) to the Omaha request. (Closed) Base URL: ssh://git@gitrw.chromium.org:9222/update_engine.git
Patch Set: fix typo Created 10 years, 4 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 | « action_pipe.h ('k') | 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 #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
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
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
OLDNEW
« no previous file with comments | « action_pipe.h ('k') | omaha_request_action_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698