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

Unified Diff: chromecast/metrics/cast_metrics_service_client.cc

Issue 506083003: Chromecast: command-line switch to override the UMA metric upload URL. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase (patch failure) Created 6 years, 4 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
« no previous file with comments | « chromecast/common/chromecast_switches.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chromecast/metrics/cast_metrics_service_client.cc
diff --git a/chromecast/metrics/cast_metrics_service_client.cc b/chromecast/metrics/cast_metrics_service_client.cc
index c90becf3d31bc0816f58b33411cfc95da10a9ff2..6409aba957e5cd24c09c2dcb710bdcd0ab630229 100644
--- a/chromecast/metrics/cast_metrics_service_client.cc
+++ b/chromecast/metrics/cast_metrics_service_client.cc
@@ -4,8 +4,10 @@
#include "chromecast/metrics/cast_metrics_service_client.h"
+#include "base/command_line.h"
#include "base/i18n/rtl.h"
#include "chromecast/common/chromecast_config.h"
+#include "chromecast/common/chromecast_switches.h"
#include "chromecast/metrics/platform_metrics_providers.h"
#include "components/metrics/client_info.h"
#include "components/metrics/metrics_provider.h"
@@ -81,10 +83,17 @@ CastMetricsServiceClient::CreateUploader(
const std::string& server_url,
const std::string& mime_type,
const base::Callback<void(int)>& on_upload_complete) {
+ std::string uma_server_url(server_url);
+ base::CommandLine* command_line = base::CommandLine::ForCurrentProcess();
+ if (command_line->HasSwitch(switches::kOverrideMetricsUploadUrl)) {
+ uma_server_url.assign(
+ command_line->GetSwitchValueASCII(switches::kOverrideMetricsUploadUrl));
+ }
+ DCHECK(!uma_server_url.empty());
return scoped_ptr< ::metrics::MetricsLogUploader>(
new ::metrics::NetMetricsLogUploader(
request_context_,
- server_url,
+ uma_server_url,
mime_type,
on_upload_complete));
}
« no previous file with comments | « chromecast/common/chromecast_switches.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698