| OLD | NEW |
| 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 <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 75 base::StringAppendF(&app, "appid=\"%s\" version=\"%s\"", item->id.c_str(), | 75 base::StringAppendF(&app, "appid=\"%s\" version=\"%s\"", item->id.c_str(), |
| 76 item->component.version.GetString().c_str()); | 76 item->component.version.GetString().c_str()); |
| 77 if (!brand.empty()) | 77 if (!brand.empty()) |
| 78 base::StringAppendF(&app, " brand=\"%s\"", brand.c_str()); | 78 base::StringAppendF(&app, " brand=\"%s\"", brand.c_str()); |
| 79 if (item->on_demand) | 79 if (item->on_demand) |
| 80 base::StringAppendF(&app, " installsource=\"ondemand\""); | 80 base::StringAppendF(&app, " installsource=\"ondemand\""); |
| 81 if (!ap.empty()) | 81 if (!ap.empty()) |
| 82 base::StringAppendF(&app, " ap=\"%s\"", ap.c_str()); | 82 base::StringAppendF(&app, " ap=\"%s\"", ap.c_str()); |
| 83 base::StringAppendF(&app, ">"); | 83 base::StringAppendF(&app, ">"); |
| 84 base::StringAppendF(&app, "<updatecheck />"); | 84 base::StringAppendF(&app, "<updatecheck />"); |
| 85 base::StringAppendF(&app, "<ping rd=\"%d\" />", | 85 base::StringAppendF(&app, "<ping rd=\"%d\" ping_freshnes=\"%s\" />", |
| 86 metadata.GetDateLastRollCall(item->id)); | 86 metadata.GetDateLastRollCall(item->id), |
| 87 metadata.GetPingFreshness(item->id).c_str()); |
| 87 if (!item->component.fingerprint.empty()) { | 88 if (!item->component.fingerprint.empty()) { |
| 88 base::StringAppendF(&app, | 89 base::StringAppendF(&app, |
| 89 "<packages>" | 90 "<packages>" |
| 90 "<package fp=\"%s\"/>" | 91 "<package fp=\"%s\"/>" |
| 91 "</packages>", | 92 "</packages>", |
| 92 item->component.fingerprint.c_str()); | 93 item->component.fingerprint.c_str()); |
| 93 } | 94 } |
| 94 base::StringAppendF(&app, "</app>"); | 95 base::StringAppendF(&app, "</app>"); |
| 95 app_elements.append(app); | 96 app_elements.append(app); |
| 96 VLOG(1) << "Appending to update request: " << app; | 97 VLOG(1) << "Appending to update request: " << app; |
| (...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 198 | 199 |
| 199 } // namespace | 200 } // namespace |
| 200 | 201 |
| 201 scoped_ptr<UpdateChecker> UpdateChecker::Create( | 202 scoped_ptr<UpdateChecker> UpdateChecker::Create( |
| 202 const scoped_refptr<Configurator>& config, | 203 const scoped_refptr<Configurator>& config, |
| 203 const PersistedData& persistent) { | 204 const PersistedData& persistent) { |
| 204 return scoped_ptr<UpdateChecker>(new UpdateCheckerImpl(config, persistent)); | 205 return scoped_ptr<UpdateChecker>(new UpdateCheckerImpl(config, persistent)); |
| 205 } | 206 } |
| 206 | 207 |
| 207 } // namespace update_client | 208 } // namespace update_client |
| OLD | NEW |