Chromium Code Reviews| Index: chrome/browser/component_updater/component_updater_ping_manager.cc |
| diff --git a/chrome/browser/component_updater/component_updater_ping_manager.cc b/chrome/browser/component_updater/component_updater_ping_manager.cc |
| index 27951f0fc40af814f71990d0ff40f1758d5471c7..cbac0ece3ff42769187e525be5775ca96312bf39 100644 |
| --- a/chrome/browser/component_updater/component_updater_ping_manager.cc |
| +++ b/chrome/browser/component_updater/component_updater_ping_manager.cc |
| @@ -40,7 +40,7 @@ class PingSender : public net::URLFetcherDelegate { |
| public: |
| PingSender(); |
| - void SendPing(const GURL& ping_url, |
| + void SendPing(const Configurator& config, |
| net::URLRequestContextGetter* url_request_context_getter, |
| const CrxUpdateItem* item); |
| @@ -50,7 +50,8 @@ class PingSender : public net::URLFetcherDelegate { |
| // Overrides for URLFetcherDelegate. |
| virtual void OnURLFetchComplete(const net::URLFetcher* source) OVERRIDE; |
| - static std::string BuildPing(const CrxUpdateItem* item); |
| + static std::string BuildPing(const Configurator& config, |
| + const CrxUpdateItem* item); |
| static std::string BuildDownloadCompleteEventElements( |
| const CrxUpdateItem* item); |
| static std::string BuildUpdateCompleteEventElement(const CrxUpdateItem* item); |
| @@ -71,20 +72,22 @@ void PingSender::OnURLFetchComplete(const net::URLFetcher* source) { |
| } |
| void PingSender::SendPing( |
| - const GURL& ping_url, |
| + const Configurator& config, |
| net::URLRequestContextGetter* url_request_context_getter, |
| const CrxUpdateItem* item) { |
| DCHECK(item); |
| - if (!ping_url.is_valid()) |
| + if (!config.PingUrl().is_valid()) |
| return; |
| url_fetcher_.reset(SendProtocolRequest( |
| - ping_url, BuildPing(item), this, url_request_context_getter)); |
| + config.PingUrl(), BuildPing(config, item), this, |
| + url_request_context_getter)); |
| } |
| // Builds a ping message for the specified update item. |
| -std::string PingSender::BuildPing(const CrxUpdateItem* item) { |
| +std::string PingSender::BuildPing(const Configurator& config, |
| + const CrxUpdateItem* item) { |
| const char app_element_format[] = |
| "<app appid=\"%s\" version=\"%s\" nextversion=\"%s\">" |
| "%s" |
| @@ -98,7 +101,9 @@ std::string PingSender::BuildPing(const CrxUpdateItem* item) { |
| BuildUpdateCompleteEventElement(item).c_str(), // update event |
| BuildDownloadCompleteEventElements(item).c_str())); // download events |
| - return BuildProtocolRequest(app_element, ""); |
| + return BuildProtocolRequest(config.GetBrowserVersion().GetString(), |
| + config.GetChannel(), config.GetLang(), |
|
Sorin Jianu
2014/07/10 16:25:23
small nit, maybe align vertically the arguments, s
tommycli
2014/07/10 17:46:36
Done.
|
| + config.GetOSLongName(), app_element, ""); |
| } |
| // Returns a string representing a sequence of download complete events |
| @@ -190,7 +195,7 @@ PingManager::~PingManager() { |
| // sender object self-deletes after sending the ping. |
| void PingManager::OnUpdateComplete(const CrxUpdateItem* item) { |
| PingSender* ping_sender(new PingSender); |
| - ping_sender->SendPing(config_.PingUrl(), config_.RequestContext(), item); |
| + ping_sender->SendPing(config_, config_.RequestContext(), item); |
| } |
| } // namespace component_updater |