| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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" |
| 11 #include "base/debug/trace_event.h" | 11 #include "base/debug/trace_event.h" |
| 12 #include "base/i18n/rtl.h" | 12 #include "base/i18n/rtl.h" |
| 13 #include "base/mac/scoped_nsautorelease_pool.h" | 13 #include "base/mac/scoped_nsautorelease_pool.h" |
| 14 #include "base/metrics/field_trial.h" | 14 #include "base/metrics/field_trial.h" |
| 15 #include "base/message_loop.h" | 15 #include "base/message_loop.h" |
| 16 #include "base/metrics/histogram.h" | 16 #include "base/metrics/histogram.h" |
| 17 #include "base/metrics/stats_counters.h" | 17 #include "base/metrics/stats_counters.h" |
| 18 #include "base/path_service.h" | 18 #include "base/path_service.h" |
| 19 #include "base/process_util.h" | 19 #include "base/process_util.h" |
| 20 #include "base/string_util.h" | 20 #include "base/string_util.h" |
| 21 #include "base/threading/platform_thread.h" | 21 #include "base/threading/platform_thread.h" |
| 22 #include "chrome/common/chrome_constants.h" | 22 #include "chrome/common/chrome_constants.h" |
| 23 #include "chrome/common/chrome_counters.h" | 23 #include "chrome/common/chrome_counters.h" |
| 24 #include "chrome/common/chrome_switches.h" | 24 #include "chrome/common/chrome_switches.h" |
| 25 #include "chrome/common/gfx_resource_provider.h" | 25 #include "chrome/common/gfx_resource_provider.h" |
| 26 #include "chrome/common/logging_chrome.h" | 26 #include "chrome/common/logging_chrome.h" |
| 27 #include "chrome/common/net/net_resource_provider.h" | 27 #include "chrome/common/net/net_resource_provider.h" |
| 28 #include "chrome/common/pepper_plugin_registry.h" | 28 #include "chrome/common/pepper_plugin_registry.h" |
| 29 #include "chrome/renderer/chrome_content_renderer_client.h" |
| 29 #include "chrome/renderer/renderer_main_platform_delegate.h" | 30 #include "chrome/renderer/renderer_main_platform_delegate.h" |
| 30 #include "chrome/renderer/render_process_impl.h" | 31 #include "chrome/renderer/render_process_impl.h" |
| 31 #include "chrome/renderer/render_thread.h" | 32 #include "chrome/renderer/render_thread.h" |
| 32 #include "content/common/main_function_params.h" | 33 #include "content/common/main_function_params.h" |
| 33 #include "content/common/hi_res_timer_manager.h" | 34 #include "content/common/hi_res_timer_manager.h" |
| 34 #include "grit/generated_resources.h" | 35 #include "grit/generated_resources.h" |
| 35 #include "net/base/net_module.h" | 36 #include "net/base/net_module.h" |
| 36 #include "ui/base/system_monitor/system_monitor.h" | 37 #include "ui/base/system_monitor/system_monitor.h" |
| 37 #include "ui/base/ui_base_switches.h" | 38 #include "ui/base/ui_base_switches.h" |
| 38 #include "ui/gfx/gfx_module.h" | 39 #include "ui/gfx/gfx_module.h" |
| (...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 173 | 174 |
| 174 if (command_line.HasSwitch(switches::kRendererStartupDialog)) { | 175 if (command_line.HasSwitch(switches::kRendererStartupDialog)) { |
| 175 ChildProcess::WaitForDebugger("Renderer"); | 176 ChildProcess::WaitForDebugger("Renderer"); |
| 176 } | 177 } |
| 177 } | 178 } |
| 178 | 179 |
| 179 // mainline routine for running as the Renderer process | 180 // mainline routine for running as the Renderer process |
| 180 int RendererMain(const MainFunctionParams& parameters) { | 181 int RendererMain(const MainFunctionParams& parameters) { |
| 181 TRACE_EVENT_BEGIN("RendererMain", 0, ""); | 182 TRACE_EVENT_BEGIN("RendererMain", 0, ""); |
| 182 | 183 |
| 184 chrome::ChromeContentRendererClient renderer_client; |
| 185 content::GetContentClient()->set_renderer(&renderer_client); |
| 186 |
| 183 const CommandLine& parsed_command_line = parameters.command_line_; | 187 const CommandLine& parsed_command_line = parameters.command_line_; |
| 184 base::mac::ScopedNSAutoreleasePool* pool = parameters.autorelease_pool_; | 188 base::mac::ScopedNSAutoreleasePool* pool = parameters.autorelease_pool_; |
| 185 | 189 |
| 186 #if defined(OS_MACOSX) | 190 #if defined(OS_MACOSX) |
| 187 // TODO(viettrungluu): Code taken from browser_main.cc. | 191 // TODO(viettrungluu): Code taken from browser_main.cc. |
| 188 int pipefd[2]; | 192 int pipefd[2]; |
| 189 int ret = pipe(pipefd); | 193 int ret = pipe(pipefd); |
| 190 if (ret < 0) { | 194 if (ret < 0) { |
| 191 PLOG(DFATAL) << "Failed to create pipe"; | 195 PLOG(DFATAL) << "Failed to create pipe"; |
| 192 } else { | 196 } else { |
| (...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 303 pool->Recycle(); | 307 pool->Recycle(); |
| 304 TRACE_EVENT_BEGIN("RendererMain.START_MSG_LOOP", 0, 0); | 308 TRACE_EVENT_BEGIN("RendererMain.START_MSG_LOOP", 0, 0); |
| 305 MessageLoop::current()->Run(); | 309 MessageLoop::current()->Run(); |
| 306 TRACE_EVENT_END("RendererMain.START_MSG_LOOP", 0, 0); | 310 TRACE_EVENT_END("RendererMain.START_MSG_LOOP", 0, 0); |
| 307 } | 311 } |
| 308 } | 312 } |
| 309 platform.PlatformUninitialize(); | 313 platform.PlatformUninitialize(); |
| 310 TRACE_EVENT_END("RendererMain", 0, ""); | 314 TRACE_EVENT_END("RendererMain", 0, ""); |
| 311 return 0; | 315 return 0; |
| 312 } | 316 } |
| OLD | NEW |