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/ping_manager.h" | 5 #include "components/update_client/ping_manager.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 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
157 const std::string app_element(base::StringPrintf( | 157 const std::string app_element(base::StringPrintf( |
158 app_element_format, | 158 app_element_format, |
159 item->id.c_str(), // "appid" | 159 item->id.c_str(), // "appid" |
160 item->previous_version.GetString().c_str(), // "version" | 160 item->previous_version.GetString().c_str(), // "version" |
161 item->next_version.GetString().c_str(), // "nextversion" | 161 item->next_version.GetString().c_str(), // "nextversion" |
162 ping_event.c_str(), // ping event | 162 ping_event.c_str(), // ping event |
163 BuildDownloadCompleteEventElements(item).c_str())); // download events | 163 BuildDownloadCompleteEventElements(item).c_str())); // download events |
164 | 164 |
165 return BuildProtocolRequest(config.GetBrowserVersion().GetString(), | 165 return BuildProtocolRequest(config.GetBrowserVersion().GetString(), |
166 config.GetChannel(), config.GetLang(), | 166 config.GetChannel(), config.GetLang(), |
167 config.GetOSLongName(), app_element, ""); | 167 config.GetOSLongName(), |
| 168 config.GetDownloadPreference(), app_element, ""); |
168 } | 169 } |
169 | 170 |
170 // Sends a fire and forget ping. The instances of this class have no | 171 // Sends a fire and forget ping. The instances of this class have no |
171 // ownership and they self-delete upon completion. One instance of this class | 172 // ownership and they self-delete upon completion. One instance of this class |
172 // can send only one ping. | 173 // can send only one ping. |
173 class PingSender { | 174 class PingSender { |
174 public: | 175 public: |
175 explicit PingSender(const scoped_refptr<Configurator>& config); | 176 explicit PingSender(const scoped_refptr<Configurator>& config); |
176 ~PingSender(); | 177 ~PingSender(); |
177 | 178 |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
225 | 226 |
226 // Sends a fire and forget ping when the updates are complete. The ping | 227 // Sends a fire and forget ping when the updates are complete. The ping |
227 // sender object self-deletes after sending the ping has completed asynchrously. | 228 // sender object self-deletes after sending the ping has completed asynchrously. |
228 void PingManager::SendPing(const CrxUpdateItem* item) { | 229 void PingManager::SendPing(const CrxUpdateItem* item) { |
229 PingSender* ping_sender(new PingSender(config_)); | 230 PingSender* ping_sender(new PingSender(config_)); |
230 if (!ping_sender->SendPing(item)) | 231 if (!ping_sender->SendPing(item)) |
231 delete ping_sender; | 232 delete ping_sender; |
232 } | 233 } |
233 | 234 |
234 } // namespace update_client | 235 } // namespace update_client |
OLD | NEW |