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

Side by Side Diff: gpu/config/gpu_util.cc

Issue 1278973003: Revert of Update SplitString calls to new form (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 | « gpu/config/gpu_test_expectations_parser.cc ('k') | media/base/mime_util.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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "gpu/config/gpu_util.h" 5 #include "gpu/config/gpu_util.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 16 matching lines...) Expand all
27 it != list.end(); ++it) { 27 it != list.end(); ++it) {
28 if (!rt.empty()) 28 if (!rt.empty())
29 rt += ","; 29 rt += ",";
30 rt += base::IntToString(*it); 30 rt += base::IntToString(*it);
31 } 31 }
32 return rt; 32 return rt;
33 } 33 }
34 34
35 void StringToIntSet(const std::string& str, std::set<int>* list) { 35 void StringToIntSet(const std::string& str, std::set<int>* list) {
36 DCHECK(list); 36 DCHECK(list);
37 for (const base::StringPiece& piece : 37 std::vector<std::string> pieces;
38 base::SplitStringPiece(str, ",", base::TRIM_WHITESPACE, 38 base::SplitString(str, ',', &pieces);
39 base::SPLIT_WANT_ALL)) { 39 for (size_t i = 0; i < pieces.size(); ++i) {
40 int number = 0; 40 int number = 0;
41 bool succeed = base::StringToInt(piece, &number); 41 bool succeed = base::StringToInt(pieces[i], &number);
42 DCHECK(succeed); 42 DCHECK(succeed);
43 list->insert(number); 43 list->insert(number);
44 } 44 }
45 } 45 }
46 46
47 } // namespace anonymous 47 } // namespace anonymous
48 48
49 void MergeFeatureSets(std::set<int>* dst, const std::set<int>& src) { 49 void MergeFeatureSets(std::set<int>* dst, const std::set<int>& src) {
50 DCHECK(dst); 50 DCHECK(dst);
51 if (src.empty()) 51 if (src.empty())
(...skipping 22 matching lines...) Expand all
74 IntSetToString(workarounds)); 74 IntSetToString(workarounds));
75 } 75 }
76 } 76 }
77 77
78 void StringToFeatureSet( 78 void StringToFeatureSet(
79 const std::string& str, std::set<int>* feature_set) { 79 const std::string& str, std::set<int>* feature_set) {
80 StringToIntSet(str, feature_set); 80 StringToIntSet(str, feature_set);
81 } 81 }
82 82
83 } // namespace gpu 83 } // namespace gpu
OLDNEW
« no previous file with comments | « gpu/config/gpu_test_expectations_parser.cc ('k') | media/base/mime_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698