Index: base/win/windows_version.h |
diff --git a/base/win/windows_version.h b/base/win/windows_version.h |
index 676bd979578b9fc07b83bed55d6d5257650858c8..7bc8b6fe560f5099ea6dec51b811d86d5b01eb4c 100644 |
--- a/base/win/windows_version.h |
+++ b/base/win/windows_version.h |
@@ -21,17 +21,20 @@ namespace win { |
// syntactic sugar reasons; see the declaration of GetVersion() below. |
// NOTE: Keep these in order so callers can do things like |
// "if (base::win::GetVersion() >= base::win::VERSION_VISTA) ...". |
+// |
+// This enum is used in metrics histograms, so they shouldn't be reordered or |
+// removed. New values can be added before VERSION_WIN_LAST. |
enum Version { |
VERSION_PRE_XP = 0, // Not supported. |
- VERSION_XP, |
- VERSION_SERVER_2003, // Also includes XP Pro x64 and Server 2003 R2. |
- VERSION_VISTA, // Also includes Windows Server 2008. |
- VERSION_WIN7, // Also includes Windows Server 2008 R2. |
- VERSION_WIN8, // Also includes Windows Server 2012. |
- VERSION_WIN8_1, // Also includes Windows Server 2012 R2. |
- VERSION_WIN10, // Also includes Windows 10 Server. |
- VERSION_WIN10_TH2, // Threshold 2: Version 1511, Build 10586. |
- VERSION_WIN_LAST, // Indicates error condition. |
+ VERSION_XP = 1, |
+ VERSION_SERVER_2003 = 2, // Also includes XP Pro x64 and Server 2003 R2. |
+ VERSION_VISTA = 3, // Also includes Windows Server 2008. |
+ VERSION_WIN7 = 4, // Also includes Windows Server 2008 R2. |
+ VERSION_WIN8 = 5, // Also includes Windows Server 2012. |
+ VERSION_WIN8_1 = 6, // Also includes Windows Server 2012 R2. |
+ VERSION_WIN10 = 7, // Also includes Windows 10 Server. |
+ VERSION_WIN10_TH2 = 8, // Threshold 2: Version 1511, Build 10586. |
+ VERSION_WIN_LAST, // Indicates error condition. |
}; |
// A rough bucketing of the available types of versions of Windows. This is used |
@@ -86,6 +89,7 @@ class BASE_EXPORT OSInfo { |
static OSInfo* GetInstance(); |
Version version() const { return version_; } |
+ Version Kernel32Version() const; |
// The next two functions return arrays of values, [major, minor(, build)]. |
VersionNumber version_number() const { return version_number_; } |
VersionType version_type() const { return version_type_; } |
@@ -105,6 +109,8 @@ class BASE_EXPORT OSInfo { |
~OSInfo(); |
Version version_; |
+ mutable Version kernel32_version_; |
+ mutable bool got_kernel32_version_; |
VersionNumber version_number_; |
VersionType version_type_; |
ServicePack service_pack_; |