Index: components/update_client/ping_manager.cc |
diff --git a/components/component_updater/component_updater_ping_manager.cc b/components/update_client/ping_manager.cc |
similarity index 83% |
rename from components/component_updater/component_updater_ping_manager.cc |
rename to components/update_client/ping_manager.cc |
index 8bfd5ed9f9c8addd66680e6983e680582a3b6a31..d3eb83cfea3992668b8f831a731fb515df7cae22 100644 |
--- a/components/component_updater/component_updater_ping_manager.cc |
+++ b/components/update_client/ping_manager.cc |
@@ -2,7 +2,7 @@ |
// Use of this source code is governed by a BSD-style license that can be |
// found in the LICENSE file. |
-#include "components/component_updater/component_updater_ping_manager.h" |
+#include "components/update_client/ping_manager.h" |
#include <string> |
#include <vector> |
@@ -19,17 +19,14 @@ |
#include "base/strings/string_util.h" |
#include "base/strings/stringprintf.h" |
#include "base/threading/thread_checker.h" |
-#include "components/component_updater/component_updater_configurator.h" |
-#include "components/component_updater/component_updater_utils.h" |
-#include "components/component_updater/crx_update_item.h" |
-#include "components/component_updater/request_sender.h" |
+#include "components/update_client/configurator.h" |
+#include "components/update_client/crx_update_item.h" |
+#include "components/update_client/request_sender.h" |
+#include "components/update_client/utils.h" |
+#include "net/url_request/url_fetcher.h" |
#include "url/gurl.h" |
-namespace net { |
-class URLFetcher; |
-} // namespace net |
- |
-namespace component_updater { |
+namespace update_client { |
namespace { |
@@ -54,8 +51,7 @@ std::string BuildDownloadCompleteEventElements(const CrxUpdateItem* item) { |
const CrxDownloader::DownloadMetrics& metrics = item->download_metrics[i]; |
std::string event("<event eventtype=\"14\""); |
StringAppendF(&event, " eventresult=\"%d\"", metrics.error == 0); |
- StringAppendF(&event, |
- " downloader=\"%s\"", |
+ StringAppendF(&event, " downloader=\"%s\"", |
DownloaderToString(metrics.downloader)); |
if (metrics.error) { |
StringAppendF(&event, " errorcode=\"%d\"", metrics.error); |
@@ -64,19 +60,16 @@ std::string BuildDownloadCompleteEventElements(const CrxUpdateItem* item) { |
// -1 means that the byte counts are not known. |
if (metrics.downloaded_bytes != -1) { |
- StringAppendF(&event, |
- " downloaded=\"%s\"", |
+ StringAppendF(&event, " downloaded=\"%s\"", |
base::Int64ToString(metrics.downloaded_bytes).c_str()); |
} |
if (metrics.total_bytes != -1) { |
- StringAppendF(&event, |
- " total=\"%s\"", |
+ StringAppendF(&event, " total=\"%s\"", |
base::Int64ToString(metrics.total_bytes).c_str()); |
} |
if (metrics.download_time_ms) { |
- StringAppendF(&event, |
- " download_time_ms=\"%s\"", |
+ StringAppendF(&event, " download_time_ms=\"%s\"", |
base::Uint64ToString(metrics.download_time_ms).c_str()); |
} |
StringAppendF(&event, "/>"); |
@@ -105,14 +98,14 @@ std::string BuildUpdateCompleteEventElement(const CrxUpdateItem* item) { |
if (HasDiffUpdate(item)) |
StringAppendF(&ping_event, " diffresult=\"%d\"", !item->diff_update_failed); |
if (item->diff_error_category) { |
- StringAppendF( |
- &ping_event, " differrorcat=\"%d\"", item->diff_error_category); |
+ StringAppendF(&ping_event, " differrorcat=\"%d\"", |
+ item->diff_error_category); |
} |
if (item->diff_error_code) |
StringAppendF(&ping_event, " differrorcode=\"%d\"", item->diff_error_code); |
if (item->diff_extra_code1) { |
- StringAppendF( |
- &ping_event, " diffextracode1=\"%d\"", item->diff_extra_code1); |
+ StringAppendF(&ping_event, " diffextracode1=\"%d\"", |
+ item->diff_extra_code1); |
} |
if (!item->previous_fp.empty()) |
StringAppendF(&ping_event, " previousfp=\"%s\"", item->previous_fp.c_str()); |
@@ -138,11 +131,8 @@ std::string BuildPing(const Configurator& config, const CrxUpdateItem* item) { |
BuildDownloadCompleteEventElements(item).c_str())); // download events |
return BuildProtocolRequest(config.GetBrowserVersion().GetString(), |
- config.GetChannel(), |
- config.GetLang(), |
- config.GetOSLongName(), |
- app_element, |
- ""); |
+ config.GetChannel(), config.GetLang(), |
+ config.GetOSLongName(), app_element, ""); |
} |
// Sends a fire and forget ping. The instances of this class have no |
@@ -188,8 +178,7 @@ bool PingSender::SendPing(const CrxUpdateItem* item) { |
request_sender_.reset(new RequestSender(config_)); |
request_sender_->Send( |
- BuildPing(config_, item), |
- urls, |
+ BuildPing(config_, item), urls, |
base::Bind(&PingSender::OnRequestSenderComplete, base::Unretained(this))); |
return true; |
} |
@@ -210,4 +199,4 @@ void PingManager::OnUpdateComplete(const CrxUpdateItem* item) { |
delete ping_sender; |
} |
-} // namespace component_updater |
+} // namespace update_client |