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

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

Issue 1284833004: Remove remaining legacy SplitString calls. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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 unified diff | Download patch
« no previous file with comments | « chrome/browser/ui/webui/about_ui.cc ('k') | chromecast/net/net_util_cast.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 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
47 std::string* app_id, 47 std::string* app_id,
48 std::string* session_id, 48 std::string* session_id,
49 std::string* sdk_version) { 49 std::string* sdk_version) {
50 DCHECK(action_name); 50 DCHECK(action_name);
51 DCHECK(app_id); 51 DCHECK(app_id);
52 DCHECK(session_id); 52 DCHECK(session_id);
53 DCHECK(sdk_version); 53 DCHECK(sdk_version);
54 if (metrics_name.find(kMetricsNameAppInfoDelimiter) == std::string::npos) 54 if (metrics_name.find(kMetricsNameAppInfoDelimiter) == std::string::npos)
55 return false; 55 return false;
56 56
57 std::vector<std::string> tokens; 57 std::vector<std::string> tokens = base::SplitString(
58 base::SplitString(metrics_name, kMetricsNameAppInfoDelimiter, &tokens); 58 metrics_name, std::string(1, kMetricsNameAppInfoDelimiter),
59 base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL);
59 DCHECK_EQ(tokens.size(), 4u); 60 DCHECK_EQ(tokens.size(), 4u);
60 // The order of tokens should match EncodeAppInfoIntoMetricsName(). 61 // The order of tokens should match EncodeAppInfoIntoMetricsName().
61 *action_name = tokens[0]; 62 *action_name = tokens[0];
62 *app_id = tokens[1]; 63 *app_id = tokens[1];
63 *session_id = tokens[2]; 64 *session_id = tokens[2];
64 *sdk_version = tokens[3]; 65 *sdk_version = tokens[3];
65 return true; 66 return true;
66 } 67 }
67 68
68 // static 69 // static
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after
247 const base::TimeDelta& value) { 248 const base::TimeDelta& value) {
248 // Follow UMA_HISTOGRAM_MEDIUM_TIMES definition. 249 // Follow UMA_HISTOGRAM_MEDIUM_TIMES definition.
249 LogTimeHistogramEvent(name, value, 250 LogTimeHistogramEvent(name, value,
250 base::TimeDelta::FromMilliseconds(10), 251 base::TimeDelta::FromMilliseconds(10),
251 base::TimeDelta::FromMinutes(3), 252 base::TimeDelta::FromMinutes(3),
252 50); 253 50);
253 } 254 }
254 255
255 } // namespace metrics 256 } // namespace metrics
256 } // namespace chromecast 257 } // namespace chromecast
OLDNEW
« no previous file with comments | « chrome/browser/ui/webui/about_ui.cc ('k') | chromecast/net/net_util_cast.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698