| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "chrome/browser/obsolete_system/obsolete_system.h" | 5 #include "chrome/browser/obsolete_system/obsolete_system.h" |
| 6 | 6 |
| 7 #include <stdint.h> | 7 #include <stdint.h> |
| 8 | 8 |
| 9 #include "build/build_config.h" | 9 #include "build/build_config.h" |
| 10 | 10 |
| 11 #if defined(GOOGLE_CHROME_BUILD) && !defined(OS_CHROMEOS) | 11 #if defined(GOOGLE_CHROME_BUILD) && !defined(OS_CHROMEOS) |
| 12 #include <gnu/libc-version.h> | 12 #include <gnu/libc-version.h> |
| 13 | 13 |
| 14 #include "base/sys_info.h" | 14 #include "base/sys_info.h" |
| 15 #include "base/version.h" | 15 #include "base/version.h" |
| 16 #include "chrome/common/url_constants.h" | 16 #include "chrome/common/url_constants.h" |
| 17 #include "chrome/grit/chromium_strings.h" | 17 #include "chrome/grit/chromium_strings.h" |
| 18 #include "ui/base/l10n/l10n_util.h" | 18 #include "ui/base/l10n/l10n_util.h" |
| 19 #endif | 19 #endif |
| 20 | 20 |
| 21 // static | 21 // static |
| 22 bool ObsoleteSystem::IsObsoleteNowOrSoon() { | 22 bool ObsoleteSystem::IsObsoleteNowOrSoon() { |
| 23 #if defined(GOOGLE_CHROME_BUILD) && !defined(OS_CHROMEOS) | 23 #if defined(GOOGLE_CHROME_BUILD) && !defined(OS_CHROMEOS) |
| 24 #if defined(ARCH_CPU_32_BITS) | 24 #if defined(ARCH_CPU_32_BITS) |
| 25 return true; | 25 return true; |
| 26 #else | 26 #else |
| 27 // Ubuntu 14.04 will be used as the next build platform, and it ships with | 27 // Ubuntu 14.04 will be used as the next build platform, and it ships with |
| 28 // glibc 2.19, so check for that as the minimum requirement. | 28 // glibc 2.19. However, as of this writing, the binary produced on Ubuntu |
| 29 // 14.04 does not actually require glibc 2.19. Thus this function checks for |
| 30 // glibc 2.17 as the minimum requirement, so Ubuntu 12.04 (glibc 2.15) will |
| 31 // be considered obsolete, but RHEL 7 (glibc 2.17) will not. |
| 29 Version version(gnu_get_libc_version()); | 32 Version version(gnu_get_libc_version()); |
| 30 if (!version.IsValid() || version.components().size() != 2) | 33 if (!version.IsValid() || version.components().size() != 2) |
| 31 return false; | 34 return false; |
| 32 | 35 |
| 33 uint32_t glibc_major_version = version.components()[0]; | 36 uint32_t glibc_major_version = version.components()[0]; |
| 34 uint32_t glibc_minor_version = version.components()[1]; | 37 uint32_t glibc_minor_version = version.components()[1]; |
| 35 if (glibc_major_version < 2) | 38 if (glibc_major_version < 2) |
| 36 return true; | 39 return true; |
| 37 | 40 |
| 38 return glibc_major_version == 2 && glibc_minor_version < 19; | 41 return glibc_major_version == 2 && glibc_minor_version < 17; |
| 39 #endif // defined(ARCH_CPU_32_BITS) | 42 #endif // defined(ARCH_CPU_32_BITS) |
| 40 #else | 43 #else |
| 41 return false; | 44 return false; |
| 42 #endif // defined(GOOGLE_CHROME_BUILD) && !defined(OS_CHROMEOS) | 45 #endif // defined(GOOGLE_CHROME_BUILD) && !defined(OS_CHROMEOS) |
| 43 } | 46 } |
| 44 | 47 |
| 45 // static | 48 // static |
| 46 base::string16 ObsoleteSystem::LocalizedObsoleteString() { | 49 base::string16 ObsoleteSystem::LocalizedObsoleteString() { |
| 47 #if defined(GOOGLE_CHROME_BUILD) && !defined(OS_CHROMEOS) | 50 #if defined(GOOGLE_CHROME_BUILD) && !defined(OS_CHROMEOS) |
| 48 const bool is_eol = IsEndOfTheLine(); | 51 const bool is_eol = IsEndOfTheLine(); |
| (...skipping 19 matching lines...) Expand all Loading... |
| 68 } | 71 } |
| 69 | 72 |
| 70 // static | 73 // static |
| 71 const char* ObsoleteSystem::GetLinkURL() { | 74 const char* ObsoleteSystem::GetLinkURL() { |
| 72 #if defined(GOOGLE_CHROME_BUILD) && !defined(OS_CHROMEOS) | 75 #if defined(GOOGLE_CHROME_BUILD) && !defined(OS_CHROMEOS) |
| 73 return chrome::kLinuxWheezyPreciseDeprecationURL; | 76 return chrome::kLinuxWheezyPreciseDeprecationURL; |
| 74 #else | 77 #else |
| 75 return ""; | 78 return ""; |
| 76 #endif | 79 #endif |
| 77 } | 80 } |
| OLD | NEW |