OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include <stdlib.h> | 5 #include <stdlib.h> |
6 | 6 |
7 #if defined(OS_WIN) | 7 #if defined(OS_WIN) |
8 #include <windows.h> | 8 #include <windows.h> |
9 #endif | 9 #endif |
10 | 10 |
11 #include "base/environment.h" | 11 #include "base/environment.h" |
12 #include "base/message_loop.h" | 12 #include "base/message_loop.h" |
13 #include "base/stringprintf.h" | 13 #include "base/stringprintf.h" |
14 #include "base/threading/platform_thread.h" | 14 #include "base/threading/platform_thread.h" |
15 #include "base/win/scoped_com_initializer.h" | 15 #include "base/win/scoped_com_initializer.h" |
16 #include "build/build_config.h" | 16 #include "build/build_config.h" |
17 #include "content/common/gpu/gpu_config.h" | 17 #include "content/common/gpu/gpu_config.h" |
18 #include "content/public/common/content_switches.h" | 18 #include "content/public/common/content_switches.h" |
19 #include "content/public/common/main_function_params.h" | 19 #include "content/public/common/main_function_params.h" |
20 #include "content/gpu/gpu_child_thread.h" | 20 #include "content/gpu/gpu_child_thread.h" |
21 #include "content/gpu/gpu_process.h" | 21 #include "content/gpu/gpu_process.h" |
22 #include "ui/gfx/gl/gl_surface.h" | 22 #include "ui/gfx/gl/gl_surface.h" |
23 #include "ui/gfx/gl/gl_switches.h" | 23 #include "ui/gfx/gl/gl_switches.h" |
24 | 24 |
25 #if defined(OS_WIN) | 25 #if defined(OS_WIN) |
| 26 #include "content/common/gpu/media/dxva_video_decode_accelerator.h" |
26 #include "sandbox/src/sandbox.h" | 27 #include "sandbox/src/sandbox.h" |
27 #endif | 28 #endif |
28 | 29 |
29 #if defined(USE_X11) | 30 #if defined(USE_X11) |
30 #include "ui/base/x/x11_util.h" | 31 #include "ui/base/x/x11_util.h" |
31 #endif | 32 #endif |
32 | 33 |
33 #if defined(TOOLKIT_USES_GTK) | 34 #if defined(TOOLKIT_USES_GTK) |
34 #include "ui/gfx/gtk_util.h" | 35 #include "ui/gfx/gtk_util.h" |
35 #endif | 36 #endif |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
76 if (!gfx::GLSurface::InitializeOneOff()) { | 77 if (!gfx::GLSurface::InitializeOneOff()) { |
77 LOG(INFO) << "gfx::GLSurface::InitializeOneOff failed"; | 78 LOG(INFO) << "gfx::GLSurface::InitializeOneOff failed"; |
78 dead_on_arrival = true; | 79 dead_on_arrival = true; |
79 } | 80 } |
80 | 81 |
81 base::win::ScopedCOMInitializer com_initializer; | 82 base::win::ScopedCOMInitializer com_initializer; |
82 | 83 |
83 #if defined(OS_WIN) | 84 #if defined(OS_WIN) |
84 sandbox::TargetServices* target_services = | 85 sandbox::TargetServices* target_services = |
85 parameters.sandbox_info->target_services; | 86 parameters.sandbox_info->target_services; |
| 87 // Initialize H/W video decoding stuff which fails in the sandbox. |
| 88 DXVAVideoDecodeAccelerator::PreSandboxInitialization(); |
86 // For windows, if the target_services interface is not zero, the process | 89 // For windows, if the target_services interface is not zero, the process |
87 // is sandboxed and we must call LowerToken() before rendering untrusted | 90 // is sandboxed and we must call LowerToken() before rendering untrusted |
88 // content. | 91 // content. |
89 if (target_services) | 92 if (target_services) |
90 target_services->LowerToken(); | 93 target_services->LowerToken(); |
91 #endif | 94 #endif |
92 | 95 |
93 MessageLoop::Type message_loop_type = MessageLoop::TYPE_UI; | 96 MessageLoop::Type message_loop_type = MessageLoop::TYPE_UI; |
94 #if defined(OS_WIN) | 97 #if defined(OS_WIN) |
95 // Unless we're running on desktop GL, we don't need a UI message | 98 // Unless we're running on desktop GL, we don't need a UI message |
(...skipping 17 matching lines...) Expand all Loading... |
113 child_thread->Init(start_time); | 116 child_thread->Init(start_time); |
114 | 117 |
115 gpu_process.set_main_thread(child_thread); | 118 gpu_process.set_main_thread(child_thread); |
116 | 119 |
117 main_message_loop.Run(); | 120 main_message_loop.Run(); |
118 | 121 |
119 child_thread->StopWatchdog(); | 122 child_thread->StopWatchdog(); |
120 | 123 |
121 return 0; | 124 return 0; |
122 } | 125 } |
OLD | NEW |