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

Unified Diff: components/update_client/utils.cc

Issue 2856573003: Fix the broken XML parser due to version mismatch. (Closed)
Patch Set: Created 3 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « components/update_client/update_response_unittest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/update_client/utils.cc
diff --git a/components/update_client/utils.cc b/components/update_client/utils.cc
index 93d7ac097e7cbbcc7ce5d8e876635527076533a1..96e15a97c98a888990bd3c94f8ea93db468e8829 100644
--- a/components/update_client/utils.cc
+++ b/components/update_client/utils.cc
@@ -32,6 +32,7 @@
#include "components/update_client/update_client.h"
#include "components/update_client/update_client_errors.h"
#include "components/update_client/update_query_params.h"
+#include "components/update_client/update_response.h"
#include "components/update_client/updater_state.h"
#include "crypto/secure_hash.h"
#include "crypto/sha2.h"
@@ -95,9 +96,7 @@ std::string GetServicePack() {
} // namespace
-// Builds a protocol message. The protocol versions so far are:
-// * Version 3.1: it changes how the run actions are serialized.
-// * Version 3.0: it is the version implemented by the desktop updaters.
+// Builds a protocol message.
std::string BuildProtocolRequest(
const std::string& prod_id,
const std::string& browser_version,
@@ -108,9 +107,10 @@ std::string BuildProtocolRequest(
const std::string& request_body,
const std::string& additional_attributes,
const std::unique_ptr<UpdaterState::Attributes>& updater_state_attributes) {
- std::string request(
+ std::string request = base::StringPrintf(
"<?xml version=\"1.0\" encoding=\"UTF-8\"?>"
- "<request protocol=\"3.1\" ");
+ "<request protocol=\"%s\" ",
+ kProtocolVersion);
if (!additional_attributes.empty())
base::StringAppendF(&request, "%s ", additional_attributes.c_str());
« no previous file with comments | « components/update_client/update_response_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698