Index: content/ppapi_plugin/ppapi_thread.cc |
diff --git a/content/ppapi_plugin/ppapi_thread.cc b/content/ppapi_plugin/ppapi_thread.cc |
index 5ed1873cce87364ef7a0aeb231b58a3bebd2cf44..839e15bf22eb7a88f5012119a8d08bbdaa2206d4 100644 |
--- a/content/ppapi_plugin/ppapi_thread.cc |
+++ b/content/ppapi_plugin/ppapi_thread.cc |
@@ -52,6 +52,10 @@ |
#if defined(OS_WIN) |
extern sandbox::TargetServices* g_target_services; |
+// Used by EnumSystemLocales for warming up |
jschuh
2014/01/16 07:54:34
Add a blank line above this comment.
|
+static BOOL CALLBACK EnumLocalesProc(LPTSTR lpLocaleString) { |
+ return true; |
+} |
#else |
extern void* g_target_services; |
#endif |
@@ -287,7 +291,7 @@ void PpapiThread::OnLoadPlugin(const base::FilePath& path, |
if (permissions.HasPermission(ppapi::PERMISSION_FLASH) && |
base::win::OSInfo::GetInstance()->version() >= |
base::win::VERSION_VISTA ) { |
- LoadLibrary(L"dxva2.dll"); |
+ LoadLibrary(L"dxva2.dll"); |
} |
// Cause advapi32 to load before the sandbox is turned on. |
@@ -297,6 +301,17 @@ void PpapiThread::OnLoadPlugin(const base::FilePath& path, |
::GetUserDefaultLangID(); |
::GetUserDefaultLCID(); |
+ if (permissions.HasPermission(ppapi::PERMISSION_FLASH)) { |
+ // Warm up system locales. |
jschuh
2014/01/16 07:54:34
You don't need to manually load EnumSystemLocales.
|
+ typedef BOOL (WINAPI *PfnEnumSystemLocales) (LOCALE_ENUMPROC, DWORD); |
+ HMODULE hKernel32Dll = GetModuleHandleW(L"Kernel32.dll"); |
+ PfnEnumSystemLocales lfpEnumSystemLocales = (PfnEnumSystemLocales) |
+ GetProcAddress(hKernel32Dll, "EnumSystemLocalesW"); |
+ |
+ if (lfpEnumSystemLocales) |
+ lfpEnumSystemLocales(EnumLocalesProc, LCID_INSTALLED); |
+ } |
+ |
g_target_services->LowerToken(); |
} |
#endif |