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

Side by Side Diff: base/sys_info_chromeos.cc

Issue 3968001: Update code that previously constructed strings from string iterators only to... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 10 years, 2 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 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 "base/sys_info.h" 5 #include "base/sys_info.h"
6 6
7 #include "base/basictypes.h" 7 #include "base/basictypes.h"
8 #include "base/file_path.h" 8 #include "base/file_path.h"
9 #include "base/file_util.h" 9 #include "base/file_util.h"
10 #include "base/string_number_conversions.h" 10 #include "base/string_number_conversions.h"
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
47 if (std::string::npos == version_key_index) { 47 if (std::string::npos == version_key_index) {
48 return; 48 return;
49 } 49 }
50 size_t start_index = lsb_release.find_first_of('=', version_key_index); 50 size_t start_index = lsb_release.find_first_of('=', version_key_index);
51 start_index++; // Move past '='. 51 start_index++; // Move past '='.
52 size_t length = lsb_release.find_first_of('\n', start_index) - start_index; 52 size_t length = lsb_release.find_first_of('\n', start_index) - start_index;
53 std::string version = lsb_release.substr(start_index, length); 53 std::string version = lsb_release.substr(start_index, length);
54 StringTokenizer tokenizer(version, "."); 54 StringTokenizer tokenizer(version, ".");
55 for (int i = 0; i < 3 && tokenizer.GetNext(); i++) { 55 for (int i = 0; i < 3 && tokenizer.GetNext(); i++) {
56 if (0 == i) { 56 if (0 == i) {
57 StringToInt(tokenizer.token(), major_version); 57 StringToInt(tokenizer.token_begin(),
58 tokenizer.token_end(),
59 major_version);
58 *minor_version = *bugfix_version = 0; 60 *minor_version = *bugfix_version = 0;
59 } else if (1 == i) { 61 } else if (1 == i) {
60 StringToInt(tokenizer.token(), minor_version); 62 StringToInt(tokenizer.token_begin(),
63 tokenizer.token_end(),
64 minor_version);
61 } else { // 2 == i 65 } else { // 2 == i
62 StringToInt(tokenizer.token(), bugfix_version); 66 StringToInt(tokenizer.token_begin(),
67 tokenizer.token_end(),
68 bugfix_version);
63 } 69 }
64 } 70 }
65 } 71 }
66 72
67 } // namespace base 73 } // namespace base
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/autocomplete_history_manager.cc » ('j') | chrome/common/extensions/extension.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698