Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1121)

Unified Diff: chrome/browser/component_updater/component_updater_ping_manager.cc

Issue 334783002: Componentize component_updater: Move some paths/constants to component. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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 cf284acbee1d9fe307f37a2ae5f9fad7f3dabee2..091b44700515608b4929f5cf24786eafdbe09b4c 100644
--- a/chrome/browser/component_updater/component_updater_ping_manager.cc
+++ b/chrome/browser/component_updater/component_updater_ping_manager.cc
@@ -38,7 +38,8 @@ class PingSender : public net::URLFetcherDelegate {
public:
PingSender();
- void SendPing(const GURL& ping_url,
+ void SendPing(const std::string& chrome_version,
blundell 2014/06/17 19:16:24 s/chrome_version/application_version everywhere in
tommycli 2014/06/17 19:31:07 Done.
+ const std::string& platform_name, const GURL& ping_url,
net::URLRequestContextGetter* url_request_context_getter,
const CrxUpdateItem* item);
@@ -48,7 +49,9 @@ 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 std::string& chrome_version,
+ const std::string& platform_name,
+ const CrxUpdateItem* item);
static std::string BuildDownloadCompleteEventElements(
const CrxUpdateItem* item);
static std::string BuildUpdateCompleteEventElement(const CrxUpdateItem* item);
@@ -69,6 +72,8 @@ void PingSender::OnURLFetchComplete(const net::URLFetcher* source) {
}
void PingSender::SendPing(
+ const std::string& chrome_version,
+ const std::string& platform_name,
const GURL& ping_url,
net::URLRequestContextGetter* url_request_context_getter,
const CrxUpdateItem* item) {
@@ -78,11 +83,14 @@ void PingSender::SendPing(
return;
url_fetcher_.reset(SendProtocolRequest(
- ping_url, BuildPing(item), this, url_request_context_getter));
+ ping_url, BuildPing(chrome_version, platform_name, 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 std::string& chrome_version,
+ const std::string& platform_name,
+ const CrxUpdateItem* item) {
const char app_element_format[] =
"<app appid=\"%s\" version=\"%s\" nextversion=\"%s\">"
"%s"
@@ -96,7 +104,7 @@ 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(chrome_version, platform_name, app_element, "");
}
// Returns a string representing a sequence of download complete events
@@ -179,9 +187,13 @@ std::string PingSender::BuildUpdateCompleteEventElement(
}
PingManager::PingManager(
+ const std::string& application_version,
+ const std::string& platform_name,
const GURL& ping_url,
net::URLRequestContextGetter* url_request_context_getter)
- : ping_url_(ping_url),
+ : application_version_(application_version),
+ platform_name_(platform_name),
+ ping_url_(ping_url),
url_request_context_getter_(url_request_context_getter) {
}
@@ -192,7 +204,8 @@ PingManager::~PingManager() {
// sender object self-deletes after sending the ping.
void PingManager::OnUpdateComplete(const CrxUpdateItem* item) {
PingSender* ping_sender(new PingSender);
- ping_sender->SendPing(ping_url_, url_request_context_getter_, item);
+ ping_sender->SendPing(application_version_, platform_name_, ping_url_,
+ url_request_context_getter_, item);
}
} // namespace component_updater

Powered by Google App Engine
This is Rietveld 408576698