| OLD | NEW |
| 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 <vector> | 5 #include <vector> |
| 6 | 6 |
| 7 #include "base/format_macros.h" | 7 #include "base/format_macros.h" |
| 8 #include "base/string_util.h" | 8 #include "base/string_util.h" |
| 9 #include "chrome/installer/util/version.h" | 9 #include "chrome/installer/util/version.h" |
| 10 | 10 |
| (...skipping 20 matching lines...) Expand all Loading... |
| 31 && (build_ == other->build_) | 31 && (build_ == other->build_) |
| 32 && (patch_ > other->patch_))); | 32 && (patch_ > other->patch_))); |
| 33 } | 33 } |
| 34 | 34 |
| 35 installer::Version* installer::Version::GetVersionFromString( | 35 installer::Version* installer::Version::GetVersionFromString( |
| 36 const string16& version_str) { | 36 const string16& version_str) { |
| 37 std::vector<string16> numbers; | 37 std::vector<string16> numbers; |
| 38 SplitString(version_str, '.', &numbers); | 38 SplitString(version_str, '.', &numbers); |
| 39 | 39 |
| 40 if (numbers.size() != 4) { | 40 if (numbers.size() != 4) { |
| 41 LOG(ERROR) << "Invalid version string: " << version_str; |
| 41 return NULL; | 42 return NULL; |
| 42 } | 43 } |
| 43 | 44 |
| 44 return new Version(StringToInt64(numbers[0]), StringToInt64(numbers[1]), | 45 return new Version(StringToInt64(numbers[0]), StringToInt64(numbers[1]), |
| 45 StringToInt64(numbers[2]), StringToInt64(numbers[3])); | 46 StringToInt64(numbers[2]), StringToInt64(numbers[3])); |
| 46 } | 47 } |
| OLD | NEW |