Chromium Code Reviews| Index: content/ppapi_plugin/ppapi_thread.cc |
| diff --git a/content/ppapi_plugin/ppapi_thread.cc b/content/ppapi_plugin/ppapi_thread.cc |
| index ebd62ac5fcffc2316c9b62a79da6fa18e8ffc4b5..fd1af8523bc54c3da967bf506e5959e674136981 100644 |
| --- a/content/ppapi_plugin/ppapi_thread.cc |
| +++ b/content/ppapi_plugin/ppapi_thread.cc |
| @@ -58,7 +58,6 @@ |
| #if defined(OS_WIN) |
| #include "base/win/win_util.h" |
| -#include "base/win/windows_version.h" |
| #include "content/child/font_warmup_win.h" |
| #include "sandbox/win/src/sandbox.h" |
| #elif defined(OS_MACOSX) |
| @@ -75,10 +74,6 @@ const char kWidevineCdmAdapterFileName[] = "widevinecdmadapter.dll"; |
| extern sandbox::TargetServices* g_target_services; |
| // Used by EnumSystemLocales for warming up. |
| -static BOOL CALLBACK EnumLocalesProc(LPTSTR lpLocaleString) { |
| - return TRUE; |
| -} |
| - |
| static BOOL CALLBACK EnumLocalesProcEx( |
| LPWSTR lpLocaleString, |
| DWORD dwFlags, |
| @@ -92,19 +87,15 @@ static void WarmupWindowsLocales(const ppapi::PpapiPermissions& permissions) { |
| ::GetUserDefaultLCID(); |
| if (permissions.HasPermission(ppapi::PERMISSION_FLASH)) { |
| - if (base::win::GetVersion() >= base::win::VERSION_VISTA) { |
| - typedef BOOL (WINAPI *PfnEnumSystemLocalesEx) |
| - (LOCALE_ENUMPROCEX, DWORD, LPARAM, LPVOID); |
| + typedef BOOL (WINAPI *PfnEnumSystemLocalesEx) |
|
jam
2017/06/01 23:55:19
just call EnumSystemLocalesEx directly?
Patrick Monette
2017/06/02 00:34:04
Done
|
| + (LOCALE_ENUMPROCEX, DWORD, LPARAM, LPVOID); |
| - HMODULE handle_kern32 = GetModuleHandleW(L"Kernel32.dll"); |
| - PfnEnumSystemLocalesEx enum_sys_locales_ex = |
| - reinterpret_cast<PfnEnumSystemLocalesEx> |
| - (GetProcAddress(handle_kern32, "EnumSystemLocalesEx")); |
| + HMODULE handle_kern32 = GetModuleHandleW(L"Kernel32.dll"); |
| + PfnEnumSystemLocalesEx enum_sys_locales_ex = |
| + reinterpret_cast<PfnEnumSystemLocalesEx> |
| + (GetProcAddress(handle_kern32, "EnumSystemLocalesEx")); |
| - enum_sys_locales_ex(EnumLocalesProcEx, LOCALE_WINDOWS, 0, 0); |
| - } else { |
| - EnumSystemLocalesW(EnumLocalesProc, LCID_INSTALLED); |
| - } |
| + enum_sys_locales_ex(EnumLocalesProcEx, LOCALE_WINDOWS, 0, 0); |
| } |
| } |
| @@ -415,28 +406,22 @@ void PpapiThread::OnLoadPlugin(const base::FilePath& path, |
| // can be loaded. TODO(cpu): consider changing to the loading style of |
| // regular plugins. |
| if (g_target_services) { |
| - // Let Flash and Widevine CDM adapter load DXVA before lockdown on Vista+. |
| + // Let Flash and Widevine CDM adapter load DXVA before lockdown. |
| if (permissions.HasPermission(ppapi::PERMISSION_FLASH) || |
| path.BaseName().MaybeAsASCII() == kWidevineCdmAdapterFileName) { |
| - if (base::win::OSInfo::GetInstance()->version() >= |
| - base::win::VERSION_VISTA) { |
| - LoadLibraryA("dxva2.dll"); |
| - } |
| + LoadLibraryA("dxva2.dll"); |
| } |
| if (permissions.HasPermission(ppapi::PERMISSION_FLASH)) { |
| - if (base::win::OSInfo::GetInstance()->version() >= |
| - base::win::VERSION_WIN7) { |
| - base::CPU cpu; |
| - if (cpu.vendor_name() == "AuthenticAMD") { |
| - // The AMD crypto acceleration is only AMD Bulldozer and above. |
| + base::CPU cpu; |
| + if (cpu.vendor_name() == "AuthenticAMD") { |
| + // The AMD crypto acceleration is only AMD Bulldozer and above. |
| #if defined(_WIN64) |
| - LoadLibraryA("amdhcp64.dll"); |
| + LoadLibraryA("amdhcp64.dll"); |
| #else |
| - LoadLibraryA("amdhcp32.dll"); |
| + LoadLibraryA("amdhcp32.dll"); |
| #endif |
| } |
| - } |
| } |
| // Cause advapi32 to load before the sandbox is turned on. |