summaryrefslogtreecommitdiffstats
path: root/chromecast
diff options
context:
space:
mode:
authorbrettw <brettw@chromium.org>2015-07-14 15:42:19 -0700
committerCommit bot <commit-bot@chromium.org>2015-07-14 22:43:54 +0000
commit0eabfa001ba06d3c66992b95b69a988ef0633992 (patch)
treea62a2b2c2e828f99ac192c41048e247fb0aa32da /chromecast
parent28c7c11feb94dc2593e5a4bf2b7aeb9d15bd0e49 (diff)
downloadchromium_src-0eabfa001ba06d3c66992b95b69a988ef0633992.zip
chromium_src-0eabfa001ba06d3c66992b95b69a988ef0633992.tar.gz
chromium_src-0eabfa001ba06d3c66992b95b69a988ef0633992.tar.bz2
Move JoinString to the base namespace.
Change "Separator" from string to StringPIece (most are constants). Remove char versions for symmetry with SplitString. Update callers who pass empty separators to use a base::StringPiece() Change chromecast/base/metrics/cast_metrics_helper.cc to not use JoinString at all and just append to the output (code is simpler and faster). TBR=zelidrag@chromium.org for chromeos Review URL: https://codereview.chromium.org/1223153003 Cr-Commit-Position: refs/heads/master@{#338762}
Diffstat (limited to 'chromecast')
-rw-r--r--chromecast/base/metrics/cast_metrics_helper.cc14
-rw-r--r--chromecast/base/process_utils.cc2
2 files changed, 9 insertions, 7 deletions
diff --git a/chromecast/base/metrics/cast_metrics_helper.cc b/chromecast/base/metrics/cast_metrics_helper.cc
index 6d07b4a..218da4a 100644
--- a/chromecast/base/metrics/cast_metrics_helper.cc
+++ b/chromecast/base/metrics/cast_metrics_helper.cc
@@ -78,12 +78,14 @@ std::string CastMetricsHelper::EncodeAppInfoIntoMetricsName(
const std::string& app_id,
const std::string& session_id,
const std::string& sdk_version) {
- std::vector<std::string> parts;
- parts.push_back(action_name);
- parts.push_back(app_id);
- parts.push_back(session_id);
- parts.push_back(sdk_version);
- return JoinString(parts, kMetricsNameAppInfoDelimiter);
+ std::string result(action_name);
+ result.push_back(kMetricsNameAppInfoDelimiter);
+ result.append(app_id);
+ result.push_back(kMetricsNameAppInfoDelimiter);
+ result.append(session_id);
+ result.push_back(kMetricsNameAppInfoDelimiter);
+ result.append(sdk_version);
+ return result;
}
// static
diff --git a/chromecast/base/process_utils.cc b/chromecast/base/process_utils.cc
index 523fb1c..9e379a0 100644
--- a/chromecast/base/process_utils.cc
+++ b/chromecast/base/process_utils.cc
@@ -17,7 +17,7 @@ bool GetAppOutput(const std::vector<std::string>& argv, std::string* output) {
DCHECK(output);
// Join the args into one string, creating the command.
- std::string command = JoinString(argv, ' ');
+ std::string command = base::JoinString(argv, " ");
// Open the process.
FILE* fp = popen(command.c_str(), "r");