| 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 <memory> | 9 #include <memory> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 155 } | 155 } |
| 156 | 156 |
| 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( |
| 166 config.GetChannel(), config.GetLang(), | 166 config.GetProdId(), config.GetBrowserVersion().GetString(), |
| 167 config.GetOSLongName(), | 167 config.GetChannel(), config.GetLang(), config.GetOSLongName(), |
| 168 config.GetDownloadPreference(), app_element, ""); | 168 config.GetDownloadPreference(), app_element, ""); |
| 169 } | 169 } |
| 170 | 170 |
| 171 // 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 |
| 172 // 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 |
| 173 // can send only one ping. | 173 // can send only one ping. |
| 174 class PingSender { | 174 class PingSender { |
| 175 public: | 175 public: |
| 176 explicit PingSender(const scoped_refptr<Configurator>& config); | 176 explicit PingSender(const scoped_refptr<Configurator>& config); |
| 177 ~PingSender(); | 177 ~PingSender(); |
| 178 | 178 |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 234 std::unique_ptr<PingSender> ping_sender(new PingSender(config_)); | 234 std::unique_ptr<PingSender> ping_sender(new PingSender(config_)); |
| 235 if (!ping_sender->SendPing(item)) | 235 if (!ping_sender->SendPing(item)) |
| 236 return false; | 236 return false; |
| 237 | 237 |
| 238 // The ping sender object self-deletes after sending the ping asynchrously. | 238 // The ping sender object self-deletes after sending the ping asynchrously. |
| 239 ping_sender.release(); | 239 ping_sender.release(); |
| 240 return true; | 240 return true; |
| 241 } | 241 } |
| 242 | 242 |
| 243 } // namespace update_client | 243 } // namespace update_client |
| OLD | NEW |