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 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
127 const std::string app_element(base::StringPrintf( | 127 const std::string app_element(base::StringPrintf( |
128 app_element_format, | 128 app_element_format, |
129 item->id.c_str(), // "appid" | 129 item->id.c_str(), // "appid" |
130 item->previous_version.GetString().c_str(), // "version" | 130 item->previous_version.GetString().c_str(), // "version" |
131 item->next_version.GetString().c_str(), // "nextversion" | 131 item->next_version.GetString().c_str(), // "nextversion" |
132 BuildUpdateCompleteEventElement(item).c_str(), // update event | 132 BuildUpdateCompleteEventElement(item).c_str(), // update event |
133 BuildDownloadCompleteEventElements(item).c_str())); // download events | 133 BuildDownloadCompleteEventElements(item).c_str())); // download events |
134 | 134 |
135 return BuildProtocolRequest(config.GetBrowserVersion().GetString(), | 135 return BuildProtocolRequest(config.GetBrowserVersion().GetString(), |
136 config.GetChannel(), config.GetLang(), | 136 config.GetChannel(), config.GetLang(), |
137 config.GetOSLongName(), app_element, ""); | 137 config.GetOSLongName(), |
| 138 config.GetDownloadPreference(), app_element, ""); |
138 } | 139 } |
139 | 140 |
140 // Sends a fire and forget ping. The instances of this class have no | 141 // Sends a fire and forget ping. The instances of this class have no |
141 // ownership and they self-delete upon completion. One instance of this class | 142 // ownership and they self-delete upon completion. One instance of this class |
142 // can send only one ping. | 143 // can send only one ping. |
143 class PingSender { | 144 class PingSender { |
144 public: | 145 public: |
145 explicit PingSender(const scoped_refptr<Configurator>& config); | 146 explicit PingSender(const scoped_refptr<Configurator>& config); |
146 ~PingSender(); | 147 ~PingSender(); |
147 | 148 |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
195 | 196 |
196 // Sends a fire and forget ping when the updates are complete. The ping | 197 // Sends a fire and forget ping when the updates are complete. The ping |
197 // sender object self-deletes after sending the ping has completed asynchrously. | 198 // sender object self-deletes after sending the ping has completed asynchrously. |
198 void PingManager::OnUpdateComplete(const CrxUpdateItem* item) { | 199 void PingManager::OnUpdateComplete(const CrxUpdateItem* item) { |
199 PingSender* ping_sender(new PingSender(config_)); | 200 PingSender* ping_sender(new PingSender(config_)); |
200 if (!ping_sender->SendPing(item)) | 201 if (!ping_sender->SendPing(item)) |
201 delete ping_sender; | 202 delete ping_sender; |
202 } | 203 } |
203 | 204 |
204 } // namespace update_client | 205 } // namespace update_client |
OLD | NEW |