Chromium Code Reviews| Index: content/gpu/gpu_main.cc |
| =================================================================== |
| --- content/gpu/gpu_main.cc (revision 169901) |
| +++ content/gpu/gpu_main.cc (working copy) |
| @@ -168,6 +168,15 @@ |
| command_line.GetSwitchValueASCII(switches::kGpuDriverVersion); |
| GetContentClient()->SetGpuInfo(gpu_info); |
| +#if defined(OS_WIN) |
| + // Asynchronously initialize DXVA while GL is being initialized because |
| + // they both take tens of ms. |
| + base::WaitableEvent dxva_initialized(true, false); |
| + DXVAVideoDecodeAccelerator::PreSandboxInitialization( |
| + base::Bind(&base::WaitableEvent::Signal, |
| + base::Unretained(&dxva_initialized))); |
| +#endif |
| + |
| // We need to track that information for the WarmUpSandbox function. |
| bool initialized_gl_context = false; |
| // Load and initialize the GL implementation and locate the GL entry points. |
| @@ -243,6 +252,12 @@ |
| #if defined(OS_WIN) |
| { |
| + // DXVA initialization must have completed before the token is lowered. |
| + TRACE_EVENT0("gpu", "Wait for DXVA initialization"); |
| + dxva_initialized.Wait(); |
| + } |
| + |
| + { |
| TRACE_EVENT0("gpu", "Lower token"); |
| // For windows, if the target_services interface is not zero, the process |
| // is sandboxed and we must call LowerToken() before rendering untrusted |
| @@ -342,22 +357,8 @@ |
| #endif |
| #if defined(OS_WIN) |
| - { |
| - TRACE_EVENT0("gpu", "Initialize COM"); |
| - base::win::ScopedCOMInitializer com_initializer; |
|
apatrick_chromium
2012/11/29 21:54:58
This was clearly nonsense. COM would be uninitiali
|
| - } |
| - |
| - { |
| - TRACE_EVENT0("gpu", "Preload setupapi.dll"); |
| - // Preload this DLL because the sandbox prevents it from loading. |
| - LoadLibrary(L"setupapi.dll"); |
| - } |
| - |
| - { |
| - TRACE_EVENT0("gpu", "Initialize DXVA"); |
| - // Initialize H/W video decoding stuff which fails in the sandbox. |
| - DXVAVideoDecodeAccelerator::PreSandboxInitialization(); |
| - } |
| + // Preload these DLL because the sandbox prevents them from loading. |
| + LoadLibrary(L"setupapi.dll"); |
| #endif |
| } |