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 #if defined(OS_MACOSX) | 5 #if defined(OS_MACOSX) |
6 #include <signal.h> | 6 #include <signal.h> |
7 #include <unistd.h> | 7 #include <unistd.h> |
8 #endif // OS_MACOSX | 8 #endif // OS_MACOSX |
9 | 9 |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
200 std::string persistent = parsed_command_line.GetSwitchValueASCII( | 200 std::string persistent = parsed_command_line.GetSwitchValueASCII( |
201 switches::kForceFieldTestNameAndValue); | 201 switches::kForceFieldTestNameAndValue); |
202 bool ret = field_trial.CreateTrialsInChildProcess(persistent); | 202 bool ret = field_trial.CreateTrialsInChildProcess(persistent); |
203 DCHECK(ret); | 203 DCHECK(ret); |
204 } | 204 } |
205 | 205 |
206 // Load pepper plugins before engaging the sandbox. | 206 // Load pepper plugins before engaging the sandbox. |
207 PepperPluginRegistry::GetInstance(); | 207 PepperPluginRegistry::GetInstance(); |
208 | 208 |
209 { | 209 { |
210 #if !defined(OS_LINUX) | 210 #if defined(OS_WIN) || defined(OS_MACOSX) |
211 // TODO(markus): Check if it is OK to unconditionally move this | 211 // TODO(markus): Check if it is OK to unconditionally move this |
212 // instruction down. | 212 // instruction down. |
213 RenderProcessImpl render_process; | 213 RenderProcessImpl render_process; |
214 render_process.set_main_thread(new RenderThread()); | 214 render_process.set_main_thread(new RenderThread()); |
215 #endif | 215 #endif |
216 bool run_loop = true; | 216 bool run_loop = true; |
217 if (!no_sandbox) { | 217 if (!no_sandbox) { |
218 run_loop = platform.EnableSandbox(); | 218 run_loop = platform.EnableSandbox(); |
219 } else { | 219 } else { |
220 LOG(ERROR) << "Running without renderer sandbox"; | 220 LOG(ERROR) << "Running without renderer sandbox"; |
221 } | 221 } |
222 #if defined(OS_LINUX) | 222 #if defined(OS_POSIX) && !defined(OS_MACOSX) |
223 RenderProcessImpl render_process; | 223 RenderProcessImpl render_process; |
224 render_process.set_main_thread(new RenderThread()); | 224 render_process.set_main_thread(new RenderThread()); |
225 #endif | 225 #endif |
226 | 226 |
227 platform.RunSandboxTests(); | 227 platform.RunSandboxTests(); |
228 | 228 |
229 startup_timer.Stop(); // End of Startup Time Measurement. | 229 startup_timer.Stop(); // End of Startup Time Measurement. |
230 | 230 |
231 if (run_loop) { | 231 if (run_loop) { |
232 if (pool) | 232 if (pool) |
233 pool->Recycle(); | 233 pool->Recycle(); |
234 TRACE_EVENT_BEGIN_ETW("RendererMain.START_MSG_LOOP", 0, 0); | 234 TRACE_EVENT_BEGIN_ETW("RendererMain.START_MSG_LOOP", 0, 0); |
235 MessageLoop::current()->Run(); | 235 MessageLoop::current()->Run(); |
236 TRACE_EVENT_END_ETW("RendererMain.START_MSG_LOOP", 0, 0); | 236 TRACE_EVENT_END_ETW("RendererMain.START_MSG_LOOP", 0, 0); |
237 } | 237 } |
238 } | 238 } |
239 platform.PlatformUninitialize(); | 239 platform.PlatformUninitialize(); |
240 TRACE_EVENT_END_ETW("RendererMain", 0, ""); | 240 TRACE_EVENT_END_ETW("RendererMain", 0, ""); |
241 return 0; | 241 return 0; |
242 } | 242 } |
OLD | NEW |