Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 The Chromium 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 "components/update_client/protocol_builder.h" | 5 #include "components/update_client/protocol_builder.h" |
| 6 | 6 |
| 7 #include <stdint.h> | 7 #include <stdint.h> |
| 8 | 8 |
| 9 #include "base/guid.h" | 9 #include "base/guid.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 175 const std::string& additional_attributes, | 175 const std::string& additional_attributes, |
| 176 const std::unique_ptr<UpdaterState::Attributes>& updater_state_attributes) { | 176 const std::unique_ptr<UpdaterState::Attributes>& updater_state_attributes) { |
| 177 std::string request = base::StringPrintf( | 177 std::string request = base::StringPrintf( |
| 178 "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" | 178 "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" |
| 179 "<request protocol=\"%s\" ", | 179 "<request protocol=\"%s\" ", |
| 180 kProtocolVersion); | 180 kProtocolVersion); |
| 181 | 181 |
| 182 if (!additional_attributes.empty()) | 182 if (!additional_attributes.empty()) |
| 183 base::StringAppendF(&request, "%s ", additional_attributes.c_str()); | 183 base::StringAppendF(&request, "%s ", additional_attributes.c_str()); |
| 184 | 184 |
| 185 // Constant information for this updater. | |
| 186 request.append("dedup=\"cr\" acceptformat=\"crx2,crx3\" "); | |
|
Sorin Jianu
2017/05/25 00:18:53
Maybe use StringAppend to match the code around.
waffles
2017/05/25 00:25:07
Done.
| |
| 187 | |
| 185 // Chrome version and platform information. | 188 // Chrome version and platform information. |
| 186 base::StringAppendF( | 189 base::StringAppendF( |
| 187 &request, | 190 &request, |
| 188 "version=\"%s-%s\" prodversion=\"%s\" " | 191 "version=\"%s-%s\" prodversion=\"%s\" " |
| 189 "requestid=\"{%s}\" lang=\"%s\" updaterchannel=\"%s\" prodchannel=\"%s\" " | 192 "requestid=\"{%s}\" lang=\"%s\" updaterchannel=\"%s\" prodchannel=\"%s\" " |
| 190 "os=\"%s\" arch=\"%s\" nacl_arch=\"%s\"", | 193 "os=\"%s\" arch=\"%s\" nacl_arch=\"%s\"", |
| 191 prod_id.c_str(), // "version" is prefixed by prod_id. | 194 prod_id.c_str(), // "version" is prefixed by prod_id. |
| 192 browser_version.c_str(), | 195 browser_version.c_str(), |
| 193 browser_version.c_str(), // "prodversion" | 196 browser_version.c_str(), // "prodversion" |
| 194 base::GenerateGUID().c_str(), // "requestid" | 197 base::GenerateGUID().c_str(), // "requestid" |
| (...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 344 base::JoinString(component.events(), "").c_str())); // events | 347 base::JoinString(component.events(), "").c_str())); // events |
| 345 | 348 |
| 346 // The ping request does not include any updater state. | 349 // The ping request does not include any updater state. |
| 347 return BuildProtocolRequest( | 350 return BuildProtocolRequest( |
| 348 config.GetProdId(), config.GetBrowserVersion().GetString(), | 351 config.GetProdId(), config.GetBrowserVersion().GetString(), |
| 349 config.GetChannel(), config.GetLang(), config.GetOSLongName(), | 352 config.GetChannel(), config.GetLang(), config.GetOSLongName(), |
| 350 config.GetDownloadPreference(), app_element, "", nullptr); | 353 config.GetDownloadPreference(), app_element, "", nullptr); |
| 351 } | 354 } |
| 352 | 355 |
| 353 } // namespace update_client | 356 } // namespace update_client |
| OLD | NEW |