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

Side by Side Diff: chromecast/base/metrics/cast_metrics_helper.cc

Issue 1223153003: Move JoinString to the base namespace (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: windows Created 5 years, 5 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 unified diff | Download patch
« no previous file with comments | « chrome/test/chromedriver/chrome_launcher.cc ('k') | chromecast/base/process_utils.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chromecast/base/metrics/cast_metrics_helper.h" 5 #include "chromecast/base/metrics/cast_metrics_helper.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/bind_helpers.h" 8 #include "base/bind_helpers.h"
9 #include "base/location.h" 9 #include "base/location.h"
10 #include "base/metrics/histogram.h" 10 #include "base/metrics/histogram.h"
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
71 *sdk_version = tokens[3]; 71 *sdk_version = tokens[3];
72 return true; 72 return true;
73 } 73 }
74 74
75 // static 75 // static
76 std::string CastMetricsHelper::EncodeAppInfoIntoMetricsName( 76 std::string CastMetricsHelper::EncodeAppInfoIntoMetricsName(
77 const std::string& action_name, 77 const std::string& action_name,
78 const std::string& app_id, 78 const std::string& app_id,
79 const std::string& session_id, 79 const std::string& session_id,
80 const std::string& sdk_version) { 80 const std::string& sdk_version) {
81 std::vector<std::string> parts; 81 std::string result(action_name);
82 parts.push_back(action_name); 82 result.push_back(kMetricsNameAppInfoDelimiter);
83 parts.push_back(app_id); 83 result.append(app_id);
84 parts.push_back(session_id); 84 result.push_back(kMetricsNameAppInfoDelimiter);
85 parts.push_back(sdk_version); 85 result.append(session_id);
86 return JoinString(parts, kMetricsNameAppInfoDelimiter); 86 result.push_back(kMetricsNameAppInfoDelimiter);
87 result.append(sdk_version);
88 return result;
87 } 89 }
88 90
89 // static 91 // static
90 CastMetricsHelper* CastMetricsHelper::GetInstance() { 92 CastMetricsHelper* CastMetricsHelper::GetInstance() {
91 DCHECK(g_instance); 93 DCHECK(g_instance);
92 return g_instance; 94 return g_instance;
93 } 95 }
94 96
95 CastMetricsHelper::CastMetricsHelper( 97 CastMetricsHelper::CastMetricsHelper(
96 scoped_refptr<base::SingleThreadTaskRunner> task_runner) 98 scoped_refptr<base::SingleThreadTaskRunner> task_runner)
(...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after
303 const base::TimeDelta& value) { 305 const base::TimeDelta& value) {
304 // Follow UMA_HISTOGRAM_MEDIUM_TIMES definition. 306 // Follow UMA_HISTOGRAM_MEDIUM_TIMES definition.
305 LogTimeHistogramEvent(name, value, 307 LogTimeHistogramEvent(name, value,
306 base::TimeDelta::FromMilliseconds(10), 308 base::TimeDelta::FromMilliseconds(10),
307 base::TimeDelta::FromMinutes(3), 309 base::TimeDelta::FromMinutes(3),
308 50); 310 50);
309 } 311 }
310 312
311 } // namespace metrics 313 } // namespace metrics
312 } // namespace chromecast 314 } // namespace chromecast
OLDNEW
« no previous file with comments | « chrome/test/chromedriver/chrome_launcher.cc ('k') | chromecast/base/process_utils.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698