OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "build/build_config.h" | 5 #include "build/build_config.h" |
6 | 6 |
7 #if defined(OS_WIN) | 7 #if defined(OS_WIN) |
8 #include <objbase.h> | 8 #include <objbase.h> |
9 #include <windows.h> | 9 #include <windows.h> |
10 // Some directx includes can trigger deprecation warnings. | |
11 #pragma warning(disable:4995) | |
12 #include <dshow.h> | |
13 #endif | 10 #endif |
14 | 11 |
15 #include "base/bind.h" | 12 #include "base/bind.h" |
16 #include "base/command_line.h" | 13 #include "base/command_line.h" |
17 #include "base/message_loop.h" | 14 #include "base/message_loop.h" |
18 #include "base/string_util.h" | 15 #include "base/string_util.h" |
19 #include "base/system_monitor/system_monitor.h" | 16 #include "base/system_monitor/system_monitor.h" |
20 #include "base/threading/platform_thread.h" | 17 #include "base/threading/platform_thread.h" |
21 #include "content/common/child_process.h" | 18 #include "content/common/child_process.h" |
22 #include "content/common/hi_res_timer_manager.h" | 19 #include "content/common/hi_res_timer_manager.h" |
23 #include "content/plugin/plugin_thread.h" | 20 #include "content/plugin/plugin_thread.h" |
24 #include "content/public/common/content_switches.h" | 21 #include "content/public/common/content_switches.h" |
25 #include "content/public/common/main_function_params.h" | 22 #include "content/public/common/main_function_params.h" |
26 | 23 |
27 #if defined(OS_WIN) | 24 #if defined(OS_WIN) |
28 #include "base/win/scoped_comptr.h" | |
29 #include "content/common/injection_test_dll.h" | 25 #include "content/common/injection_test_dll.h" |
30 #include "sandbox/src/sandbox.h" | 26 #include "sandbox/src/sandbox.h" |
31 #elif defined(OS_POSIX) && !defined(OS_MACOSX) | 27 #elif defined(OS_POSIX) && !defined(OS_MACOSX) |
32 #include "base/global_descriptors_posix.h" | 28 #include "base/global_descriptors_posix.h" |
33 #include "ipc/ipc_descriptors.h" | 29 #include "ipc/ipc_descriptors.h" |
34 #endif | 30 #endif |
35 | 31 |
36 #if defined(OS_MACOSX) | 32 #if defined(OS_MACOSX) |
37 // Removes our Carbon library interposing from the environment so that it | 33 // Removes our Carbon library interposing from the environment so that it |
38 // doesn't carry into any processes that plugins might start. | 34 // doesn't carry into any processes that plugins might start. |
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
173 if (IsPluginBuiltInFlash(parsed_command_line)) { | 169 if (IsPluginBuiltInFlash(parsed_command_line)) { |
174 DVLOG(1) << "Sandboxing flash"; | 170 DVLOG(1) << "Sandboxing flash"; |
175 | 171 |
176 // Poke hole in the address space to improve randomization. | 172 // Poke hole in the address space to improve randomization. |
177 if (!CreateRandomMemoryHole()) { | 173 if (!CreateRandomMemoryHole()) { |
178 DVLOG(ERROR) << "Failed to create random memory hole"; | 174 DVLOG(ERROR) << "Failed to create random memory hole"; |
179 } | 175 } |
180 | 176 |
181 if (!PreloadIMEForFlash()) | 177 if (!PreloadIMEForFlash()) |
182 DVLOG(1) << "IME preload failed"; | 178 DVLOG(1) << "IME preload failed"; |
183 | |
184 // Warm up the device enumerator for webcam and microphone. | |
185 base::win::ScopedComPtr<ICreateDevEnum> device_enumerator; | |
186 device_enumerator.CreateInstance(CLSID_SystemDeviceEnum, NULL, | |
187 CLSCTX_INPROC_SERVER | | |
188 CLSCTX_INPROC_HANDLER); | |
189 | |
190 DelayedLowerToken(target_services); | 179 DelayedLowerToken(target_services); |
191 } else { | 180 } else { |
192 target_services->LowerToken(); | 181 target_services->LowerToken(); |
193 } | 182 } |
194 } | 183 } |
195 if (sandbox_test_module) { | 184 if (sandbox_test_module) { |
196 RunPluginTests run_security_tests = | 185 RunPluginTests run_security_tests = |
197 reinterpret_cast<RunPluginTests>(GetProcAddress(sandbox_test_module, | 186 reinterpret_cast<RunPluginTests>(GetProcAddress(sandbox_test_module, |
198 kPluginTestCall)); | 187 kPluginTestCall)); |
199 DCHECK(run_security_tests); | 188 DCHECK(run_security_tests); |
(...skipping 15 matching lines...) Expand all Loading... |
215 | 204 |
216 MessageLoop::current()->Run(); | 205 MessageLoop::current()->Run(); |
217 } | 206 } |
218 | 207 |
219 #if defined(OS_WIN) | 208 #if defined(OS_WIN) |
220 CoUninitialize(); | 209 CoUninitialize(); |
221 #endif | 210 #endif |
222 | 211 |
223 return 0; | 212 return 0; |
224 } | 213 } |
OLD | NEW |