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

Side by Side Diff: components/update_client/update_checker.cc

Issue 2293933003: Remove whitespace in the <ping> element closing tag in the comp updater. (Closed)
Patch Set: Created 4 years, 3 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/update_checker.h" 5 #include "components/update_client/update_checker.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <memory> 9 #include <memory>
10 #include <string> 10 #include <string>
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
57 57
58 // Builds an update check request for |components|. |additional_attributes| is 58 // Builds an update check request for |components|. |additional_attributes| is
59 // serialized as part of the <request> element of the request to customize it 59 // serialized as part of the <request> element of the request to customize it
60 // with data that is not platform or component specific. For each |item|, a 60 // with data that is not platform or component specific. For each |item|, a
61 // corresponding <app> element is created and inserted as a child node of 61 // corresponding <app> element is created and inserted as a child node of
62 // the <request>. 62 // the <request>.
63 // 63 //
64 // An app element looks like this: 64 // An app element looks like this:
65 // <app appid="hnimpnehoodheedghdeeijklkeaacbdc" 65 // <app appid="hnimpnehoodheedghdeeijklkeaacbdc"
66 // version="0.1.2.3" installsource="ondemand"> 66 // version="0.1.2.3" installsource="ondemand">
67 // <updatecheck /> 67 // <updatecheck />
waffles 2016/08/30 20:27:22 Want to remove it from the examples here and at :6
Sorin Jianu 2016/08/30 21:50:30 Done. Did I regex search and removed more whitespa
68 // <packages> 68 // <packages>
69 // <package fp="abcd" /> 69 // <package fp="abcd" />
70 // </packages> 70 // </packages>
71 // </app> 71 // </app>
72 std::string BuildUpdateCheckRequest(const Configurator& config, 72 std::string BuildUpdateCheckRequest(const Configurator& config,
73 const std::vector<CrxUpdateItem*>& items, 73 const std::vector<CrxUpdateItem*>& items,
74 PersistedData* metadata, 74 PersistedData* metadata,
75 const std::string& additional_attributes, 75 const std::string& additional_attributes,
76 bool enabled_component_updates) { 76 bool enabled_component_updates) {
77 const std::string brand(SanitizeBrand(config.GetBrand())); 77 const std::string brand(SanitizeBrand(config.GetBrand()));
(...skipping 24 matching lines...) Expand all
102 base::StringAppendF(&app, " cohorthint=\"%s\"", cohort_hint.c_str()); 102 base::StringAppendF(&app, " cohorthint=\"%s\"", cohort_hint.c_str());
103 base::StringAppendF(&app, ">"); 103 base::StringAppendF(&app, ">");
104 104
105 base::StringAppendF(&app, "<updatecheck"); 105 base::StringAppendF(&app, "<updatecheck");
106 if (item->component.supports_group_policy_enable_component_updates && 106 if (item->component.supports_group_policy_enable_component_updates &&
107 !enabled_component_updates) { 107 !enabled_component_updates) {
108 base::StringAppendF(&app, " updatedisabled=\"true\""); 108 base::StringAppendF(&app, " updatedisabled=\"true\"");
109 } 109 }
110 base::StringAppendF(&app, "/>"); 110 base::StringAppendF(&app, "/>");
111 111
112 base::StringAppendF(&app, "<ping rd=\"%d\" ping_freshness=\"%s\" />", 112 base::StringAppendF(&app, "<ping rd=\"%d\" ping_freshness=\"%s\"/>",
113 metadata->GetDateLastRollCall(item->id), 113 metadata->GetDateLastRollCall(item->id),
114 metadata->GetPingFreshness(item->id).c_str()); 114 metadata->GetPingFreshness(item->id).c_str());
115 if (!item->component.fingerprint.empty()) { 115 if (!item->component.fingerprint.empty()) {
116 base::StringAppendF(&app, 116 base::StringAppendF(&app,
117 "<packages>" 117 "<packages>"
118 "<package fp=\"%s\"/>" 118 "<package fp=\"%s\"/>"
119 "</packages>", 119 "</packages>",
120 item->component.fingerprint.c_str()); 120 item->component.fingerprint.c_str());
121 } 121 }
122 base::StringAppendF(&app, "</app>"); 122 base::StringAppendF(&app, "</app>");
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after
241 } // namespace 241 } // namespace
242 242
243 std::unique_ptr<UpdateChecker> UpdateChecker::Create( 243 std::unique_ptr<UpdateChecker> UpdateChecker::Create(
244 const scoped_refptr<Configurator>& config, 244 const scoped_refptr<Configurator>& config,
245 PersistedData* persistent) { 245 PersistedData* persistent) {
246 return std::unique_ptr<UpdateChecker>( 246 return std::unique_ptr<UpdateChecker>(
247 new UpdateCheckerImpl(config, persistent)); 247 new UpdateCheckerImpl(config, persistent));
248 } 248 }
249 249
250 } // namespace update_client 250 } // namespace update_client
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698