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

Unified Diff: chromeos/system/name_value_pairs_parser.cc

Issue 296593003: Make various string_util functions take StringPieces instead of char[]. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Resync Created 6 years, 7 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 | « chrome/renderer/chrome_render_view_observer.cc ('k') | components/autofill/core/browser/autofill_field.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chromeos/system/name_value_pairs_parser.cc
diff --git a/chromeos/system/name_value_pairs_parser.cc b/chromeos/system/name_value_pairs_parser.cc
index 39b852b40cb7341e72c2888190f61df2d5e2490d..211cce7625832e3de25a00ef91e21f2c78b087cd 100644
--- a/chromeos/system/name_value_pairs_parser.cc
+++ b/chromeos/system/name_value_pairs_parser.cc
@@ -19,9 +19,6 @@ namespace system {
namespace {
-const char kQuoteChars[] = "\"";
-const char kTrimChars[] = "\" ";
-
bool GetToolOutput(int argc, const char* argv[], std::string& output) {
DCHECK_GE(argc, 1);
@@ -72,7 +69,7 @@ bool NameValuePairsParser::ParseNameValuePairsWithComments(
bool all_valid = true;
// Set up the pair tokenizer.
base::StringTokenizer pair_toks(in_string, delim);
- pair_toks.set_quote_chars(kQuoteChars);
+ pair_toks.set_quote_chars("\"");
// Process token pairs.
while (pair_toks.GetNext()) {
std::string pair(pair_toks.token());
@@ -90,6 +87,7 @@ bool NameValuePairsParser::ParseNameValuePairsWithComments(
value_size = comment_pos - eq_pos - 1;
}
+ static const char kTrimChars[] = "\" ";
std::string key;
std::string value;
base::TrimString(pair.substr(0, eq_pos), kTrimChars, &key);
« no previous file with comments | « chrome/renderer/chrome_render_view_observer.cc ('k') | components/autofill/core/browser/autofill_field.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698