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 "base/command_line.h" | 5 #include "base/command_line.h" |
6 #include "base/debug/trace_event.h" | 6 #include "base/debug/trace_event.h" |
7 #include "base/i18n/rtl.h" | 7 #include "base/i18n/rtl.h" |
8 #include "base/mac/scoped_nsautorelease_pool.h" | 8 #include "base/mac/scoped_nsautorelease_pool.h" |
9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
10 #include "base/metrics/field_trial.h" | 10 #include "base/metrics/field_trial.h" |
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
201 | 201 |
202 { | 202 { |
203 #if defined(OS_WIN) || defined(OS_MACOSX) | 203 #if defined(OS_WIN) || defined(OS_MACOSX) |
204 // TODO(markus): Check if it is OK to unconditionally move this | 204 // TODO(markus): Check if it is OK to unconditionally move this |
205 // instruction down. | 205 // instruction down. |
206 RenderProcessImpl render_process; | 206 RenderProcessImpl render_process; |
207 render_process.set_main_thread(new RenderThread()); | 207 render_process.set_main_thread(new RenderThread()); |
208 #endif | 208 #endif |
209 bool run_loop = true; | 209 bool run_loop = true; |
210 if (!no_sandbox) { | 210 if (!no_sandbox) { |
| 211 // Cause advapi32 to load before the sandbox is turned on. |
| 212 unsigned int dummy_rand; |
| 213 rand_s(&dummy_rand); |
| 214 // Warm up language subsystems before the sandbox is turned on. |
| 215 ::GetUserDefaultLangID(); |
| 216 ::GetUserDefaultLCID(); |
211 run_loop = platform.EnableSandbox(); | 217 run_loop = platform.EnableSandbox(); |
212 } else { | 218 } else { |
213 LOG(ERROR) << "Running without renderer sandbox"; | 219 LOG(ERROR) << "Running without renderer sandbox"; |
214 } | 220 } |
215 #if defined(OS_POSIX) && !defined(OS_MACOSX) | 221 #if defined(OS_POSIX) && !defined(OS_MACOSX) |
216 RenderProcessImpl render_process; | 222 RenderProcessImpl render_process; |
217 render_process.set_main_thread(new RenderThread()); | 223 render_process.set_main_thread(new RenderThread()); |
218 #endif | 224 #endif |
219 | 225 |
220 platform.RunSandboxTests(); | 226 platform.RunSandboxTests(); |
221 | 227 |
222 startup_timer.Stop(); // End of Startup Time Measurement. | 228 startup_timer.Stop(); // End of Startup Time Measurement. |
223 | 229 |
224 if (run_loop) { | 230 if (run_loop) { |
225 if (pool) | 231 if (pool) |
226 pool->Recycle(); | 232 pool->Recycle(); |
227 TRACE_EVENT_BEGIN_ETW("RendererMain.START_MSG_LOOP", 0, 0); | 233 TRACE_EVENT_BEGIN_ETW("RendererMain.START_MSG_LOOP", 0, 0); |
228 MessageLoop::current()->Run(); | 234 MessageLoop::current()->Run(); |
229 TRACE_EVENT_END_ETW("RendererMain.START_MSG_LOOP", 0, 0); | 235 TRACE_EVENT_END_ETW("RendererMain.START_MSG_LOOP", 0, 0); |
230 } | 236 } |
231 } | 237 } |
232 platform.PlatformUninitialize(); | 238 platform.PlatformUninitialize(); |
233 TRACE_EVENT_END_ETW("RendererMain", 0, ""); | 239 TRACE_EVENT_END_ETW("RendererMain", 0, ""); |
234 return 0; | 240 return 0; |
235 } | 241 } |
OLD | NEW |