diff options
author | tedvessenes@gmail.com <tedvessenes@gmail.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-12-19 16:10:55 +0000 |
---|---|---|
committer | tedvessenes@gmail.com <tedvessenes@gmail.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-12-19 16:10:55 +0000 |
commit | eb72b27ac26621b2f1819fa318761a035689482d (patch) | |
tree | 3df45496be7931641279e35aa691ceb21ef36fa4 /base/sys_info_chromeos.cc | |
parent | cdd47ee7d8b8d2ef57b36cd6e50215320cef7963 (diff) | |
download | chromium_src-eb72b27ac26621b2f1819fa318761a035689482d.zip chromium_src-eb72b27ac26621b2f1819fa318761a035689482d.tar.gz chromium_src-eb72b27ac26621b2f1819fa318761a035689482d.tar.bz2 |
Standardize StringToInt{,64} interface.
These changes address issue #106655. All variants of StringToInt have been
converted to use the StringPiece class. One instance of conversion, in
chrome/browser/history/text_database.cc, required copying an underlying
string. This is because the string type in question could use 8 or 16
bit characters depending on the OS type, and because StringPiece is not
implemented as a template, the code cannot specify whether to create a
StringPiece or StringPiece16. This should be remedied in a future CL.
R=erikwright@chromium.org
BUG=106655
TEST=
Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=114929
Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=114944
Review URL: http://codereview.chromium.org/8921006
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@114993 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/sys_info_chromeos.cc')
-rw-r--r-- | base/sys_info_chromeos.cc | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/base/sys_info_chromeos.cc b/base/sys_info_chromeos.cc index f1c6664..f84a2a5 100644 --- a/base/sys_info_chromeos.cc +++ b/base/sys_info_chromeos.cc @@ -9,6 +9,7 @@ #include "base/file_util.h" #include "base/lazy_instance.h" #include "base/string_number_conversions.h" +#include "base/string_piece.h" #include "base/string_tokenizer.h" #include "base/threading/thread_restrictions.h" @@ -96,17 +97,17 @@ void SysInfo::ParseLsbRelease(const std::string& lsb_release, StringTokenizer tokenizer(version, "."); for (int i = 0; i < 3 && tokenizer.GetNext(); ++i) { if (0 == i) { - StringToInt(tokenizer.token_begin(), - tokenizer.token_end(), + StringToInt(StringPiece(tokenizer.token_begin(), + tokenizer.token_end()), major_version); *minor_version = *bugfix_version = 0; } else if (1 == i) { - StringToInt(tokenizer.token_begin(), - tokenizer.token_end(), + StringToInt(StringPiece(tokenizer.token_begin(), + tokenizer.token_end()), minor_version); } else { // 2 == i - StringToInt(tokenizer.token_begin(), - tokenizer.token_end(), + StringToInt(StringPiece(tokenizer.token_begin(), + tokenizer.token_end()), bugfix_version); } } |