Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(113)

Unified Diff: content/gpu/gpu_main.cc

Issue 11411249: Do DXVA pre-sandbox initialization off the main thread. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 8 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/common/gpu/media/video_decode_accelerator_unittest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
}
« no previous file with comments | « content/common/gpu/media/video_decode_accelerator_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698