| 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 "base/base_switches.h" | 5 #include "base/base_switches.h" |
| 6 #include "base/command_line.h" | 6 #include "base/command_line.h" |
| 7 #include "base/debug/debugger.h" | 7 #include "base/debug/debugger.h" |
| 8 #include "base/debug/stack_trace.h" | 8 #include "base/debug/stack_trace.h" |
| 9 #include "base/debug/trace_event.h" | 9 #include "base/debug/trace_event.h" |
| 10 #include "base/i18n/rtl.h" | 10 #include "base/i18n/rtl.h" |
| (...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 174 if (parsed_command_line.HasSwitch(switches::kMemoryMetrics)) { | 174 if (parsed_command_line.HasSwitch(switches::kMemoryMetrics)) { |
| 175 memory_observer.reset(new MemoryObserver()); | 175 memory_observer.reset(new MemoryObserver()); |
| 176 main_message_loop.AddTaskObserver(memory_observer.get()); | 176 main_message_loop.AddTaskObserver(memory_observer.get()); |
| 177 } | 177 } |
| 178 | 178 |
| 179 base::PlatformThread::SetName("CrRendererMain"); | 179 base::PlatformThread::SetName("CrRendererMain"); |
| 180 | 180 |
| 181 platform.PlatformInitialize(); | 181 platform.PlatformInitialize(); |
| 182 | 182 |
| 183 bool no_sandbox = parsed_command_line.HasSwitch(switches::kNoSandbox); | 183 bool no_sandbox = parsed_command_line.HasSwitch(switches::kNoSandbox); |
| 184 platform.InitSandboxTests(no_sandbox); | |
| 185 | 184 |
| 186 // Initialize histogram statistics gathering system. | 185 // Initialize histogram statistics gathering system. |
| 187 base::StatisticsRecorder::Initialize(); | 186 base::StatisticsRecorder::Initialize(); |
| 188 | 187 |
| 189 // Initialize statistical testing infrastructure. We set the entropy provider | 188 // Initialize statistical testing infrastructure. We set the entropy provider |
| 190 // to NULL to disallow the renderer process from creating its own one-time | 189 // to NULL to disallow the renderer process from creating its own one-time |
| 191 // randomized trials; they should be created in the browser process. | 190 // randomized trials; they should be created in the browser process. |
| 192 base::FieldTrialList field_trial_list(NULL); | 191 base::FieldTrialList field_trial_list(NULL); |
| 193 // Ensure any field trials in browser are reflected into renderer. | 192 // Ensure any field trials in browser are reflected into renderer. |
| 194 if (parsed_command_line.HasSwitch(switches::kForceFieldTrials)) { | 193 if (parsed_command_line.HasSwitch(switches::kForceFieldTrials)) { |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 232 base::debug::EnableInProcessStackDumping(); | 231 base::debug::EnableInProcessStackDumping(); |
| 233 #endif | 232 #endif |
| 234 } | 233 } |
| 235 #if defined(OS_POSIX) && !defined(OS_MACOSX) | 234 #if defined(OS_POSIX) && !defined(OS_MACOSX) |
| 236 RenderProcessImpl render_process; | 235 RenderProcessImpl render_process; |
| 237 new RenderThreadImpl(); | 236 new RenderThreadImpl(); |
| 238 #endif | 237 #endif |
| 239 | 238 |
| 240 base::HighResolutionTimerManager hi_res_timer_manager; | 239 base::HighResolutionTimerManager hi_res_timer_manager; |
| 241 | 240 |
| 242 platform.RunSandboxTests(no_sandbox); | |
| 243 | |
| 244 startup_timer.Stop(); // End of Startup Time Measurement. | 241 startup_timer.Stop(); // End of Startup Time Measurement. |
| 245 | 242 |
| 246 if (run_loop) { | 243 if (run_loop) { |
| 247 #if defined(OS_MACOSX) | 244 #if defined(OS_MACOSX) |
| 248 if (pool) | 245 if (pool) |
| 249 pool->Recycle(); | 246 pool->Recycle(); |
| 250 #endif | 247 #endif |
| 251 TRACE_EVENT_BEGIN_ETW("RendererMain.START_MSG_LOOP", 0, 0); | 248 TRACE_EVENT_BEGIN_ETW("RendererMain.START_MSG_LOOP", 0, 0); |
| 252 base::MessageLoop::current()->Run(); | 249 base::MessageLoop::current()->Run(); |
| 253 TRACE_EVENT_END_ETW("RendererMain.START_MSG_LOOP", 0, 0); | 250 TRACE_EVENT_END_ETW("RendererMain.START_MSG_LOOP", 0, 0); |
| 254 } | 251 } |
| 255 } | 252 } |
| 256 platform.PlatformUninitialize(); | 253 platform.PlatformUninitialize(); |
| 257 TRACE_EVENT_END_ETW("RendererMain", 0, ""); | 254 TRACE_EVENT_END_ETW("RendererMain", 0, ""); |
| 258 return 0; | 255 return 0; |
| 259 } | 256 } |
| 260 | 257 |
| 261 } // namespace content | 258 } // namespace content |
| OLD | NEW |