| 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 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 50 #endif | 50 #endif |
| 51 | 51 |
| 52 #if defined(ENABLE_WEBRTC) | 52 #if defined(ENABLE_WEBRTC) |
| 53 #include "third_party/libjingle/overrides/init_webrtc.h" | 53 #include "third_party/libjingle/overrides/init_webrtc.h" |
| 54 #endif | 54 #endif |
| 55 | 55 |
| 56 namespace content { | 56 namespace content { |
| 57 namespace { | 57 namespace { |
| 58 // This function provides some ways to test crash and assertion handling | 58 // This function provides some ways to test crash and assertion handling |
| 59 // behavior of the renderer. | 59 // behavior of the renderer. |
| 60 static void HandleRendererErrorTestParameters(const CommandLine& command_line) { | 60 static void HandleRendererErrorTestParameters( |
| 61 const base::CommandLine& command_line) { |
| 61 if (command_line.HasSwitch(switches::kWaitForDebugger)) | 62 if (command_line.HasSwitch(switches::kWaitForDebugger)) |
| 62 base::debug::WaitForDebugger(60, true); | 63 base::debug::WaitForDebugger(60, true); |
| 63 | 64 |
| 64 if (command_line.HasSwitch(switches::kRendererStartupDialog)) | 65 if (command_line.HasSwitch(switches::kRendererStartupDialog)) |
| 65 ChildProcess::WaitForDebugger("Renderer"); | 66 ChildProcess::WaitForDebugger("Renderer"); |
| 66 | 67 |
| 67 // This parameter causes an assertion. | 68 // This parameter causes an assertion. |
| 68 if (command_line.HasSwitch(switches::kRendererAssertTest)) { | 69 if (command_line.HasSwitch(switches::kRendererAssertTest)) { |
| 69 DCHECK(false); | 70 DCHECK(false); |
| 70 } | 71 } |
| (...skipping 26 matching lines...) Expand all Loading... |
| 97 | 98 |
| 98 } // namespace | 99 } // namespace |
| 99 | 100 |
| 100 // mainline routine for running as the Renderer process | 101 // mainline routine for running as the Renderer process |
| 101 int RendererMain(const MainFunctionParams& parameters) { | 102 int RendererMain(const MainFunctionParams& parameters) { |
| 102 TRACE_EVENT_BEGIN_ETW("RendererMain", 0, ""); | 103 TRACE_EVENT_BEGIN_ETW("RendererMain", 0, ""); |
| 103 base::debug::TraceLog::GetInstance()->SetProcessName("Renderer"); | 104 base::debug::TraceLog::GetInstance()->SetProcessName("Renderer"); |
| 104 base::debug::TraceLog::GetInstance()->SetProcessSortIndex( | 105 base::debug::TraceLog::GetInstance()->SetProcessSortIndex( |
| 105 kTraceEventRendererProcessSortIndex); | 106 kTraceEventRendererProcessSortIndex); |
| 106 | 107 |
| 107 const CommandLine& parsed_command_line = parameters.command_line; | 108 const base::CommandLine& parsed_command_line = parameters.command_line; |
| 108 | 109 |
| 109 #if defined(OS_MACOSX) | 110 #if defined(OS_MACOSX) |
| 110 base::mac::ScopedNSAutoreleasePool* pool = parameters.autorelease_pool; | 111 base::mac::ScopedNSAutoreleasePool* pool = parameters.autorelease_pool; |
| 111 #endif // OS_MACOSX | 112 #endif // OS_MACOSX |
| 112 | 113 |
| 113 #if defined(OS_CHROMEOS) | 114 #if defined(OS_CHROMEOS) |
| 114 // As Zygote process starts up earlier than browser process gets its own | 115 // As Zygote process starts up earlier than browser process gets its own |
| 115 // locale (at login time for Chrome OS), we have to set the ICU default | 116 // locale (at login time for Chrome OS), we have to set the ICU default |
| 116 // locale for renderer process here. | 117 // locale for renderer process here. |
| 117 // ICU locale will be used for fallback font selection etc. | 118 // ICU locale will be used for fallback font selection etc. |
| (...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 234 base::MessageLoop::current()->Run(); | 235 base::MessageLoop::current()->Run(); |
| 235 TRACE_EVENT_END_ETW("RendererMain.START_MSG_LOOP", 0, 0); | 236 TRACE_EVENT_END_ETW("RendererMain.START_MSG_LOOP", 0, 0); |
| 236 } | 237 } |
| 237 } | 238 } |
| 238 platform.PlatformUninitialize(); | 239 platform.PlatformUninitialize(); |
| 239 TRACE_EVENT_END_ETW("RendererMain", 0, ""); | 240 TRACE_EVENT_END_ETW("RendererMain", 0, ""); |
| 240 return 0; | 241 return 0; |
| 241 } | 242 } |
| 242 | 243 |
| 243 } // namespace content | 244 } // namespace content |
| OLD | NEW |