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 "app/hi_res_timer_manager.h" | 10 #include "app/hi_res_timer_manager.h" |
11 #include "app/system_monitor.h" | 11 #include "app/system_monitor.h" |
12 #include "base/command_line.h" | 12 #include "base/command_line.h" |
| 13 #include "base/mac/scoped_nsautorelease_pool.h" |
13 #include "base/metrics/field_trial.h" | 14 #include "base/metrics/field_trial.h" |
14 #include "base/message_loop.h" | 15 #include "base/message_loop.h" |
15 #include "base/metrics/histogram.h" | 16 #include "base/metrics/histogram.h" |
16 #include "base/metrics/stats_counters.h" | 17 #include "base/metrics/stats_counters.h" |
17 #include "base/path_service.h" | 18 #include "base/path_service.h" |
18 #include "base/platform_thread.h" | 19 #include "base/platform_thread.h" |
19 #include "base/process_util.h" | 20 #include "base/process_util.h" |
20 #include "base/scoped_nsautorelease_pool.h" | |
21 #include "base/string_util.h" | 21 #include "base/string_util.h" |
22 #include "base/trace_event.h" | 22 #include "base/trace_event.h" |
23 #include "chrome/common/chrome_constants.h" | 23 #include "chrome/common/chrome_constants.h" |
24 #include "chrome/common/chrome_counters.h" | 24 #include "chrome/common/chrome_counters.h" |
25 #include "chrome/common/chrome_switches.h" | 25 #include "chrome/common/chrome_switches.h" |
26 #include "chrome/common/logging_chrome.h" | 26 #include "chrome/common/logging_chrome.h" |
27 #include "chrome/common/main_function_params.h" | 27 #include "chrome/common/main_function_params.h" |
28 #include "chrome/common/net/net_resource_provider.h" | 28 #include "chrome/common/net/net_resource_provider.h" |
29 #include "chrome/common/pepper_plugin_registry.h" | 29 #include "chrome/common/pepper_plugin_registry.h" |
30 #include "chrome/renderer/renderer_main_platform_delegate.h" | 30 #include "chrome/renderer/renderer_main_platform_delegate.h" |
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
173 if (command_line.HasSwitch(switches::kRendererStartupDialog)) { | 173 if (command_line.HasSwitch(switches::kRendererStartupDialog)) { |
174 ChildProcess::WaitForDebugger(L"Renderer"); | 174 ChildProcess::WaitForDebugger(L"Renderer"); |
175 } | 175 } |
176 } | 176 } |
177 | 177 |
178 // mainline routine for running as the Renderer process | 178 // mainline routine for running as the Renderer process |
179 int RendererMain(const MainFunctionParams& parameters) { | 179 int RendererMain(const MainFunctionParams& parameters) { |
180 TRACE_EVENT_BEGIN("RendererMain", 0, ""); | 180 TRACE_EVENT_BEGIN("RendererMain", 0, ""); |
181 | 181 |
182 const CommandLine& parsed_command_line = parameters.command_line_; | 182 const CommandLine& parsed_command_line = parameters.command_line_; |
183 base::ScopedNSAutoreleasePool* pool = parameters.autorelease_pool_; | 183 base::mac::ScopedNSAutoreleasePool* pool = parameters.autorelease_pool_; |
184 | 184 |
185 #if defined(OS_MACOSX) | 185 #if defined(OS_MACOSX) |
186 // TODO(viettrungluu): Code taken from browser_main.cc. | 186 // TODO(viettrungluu): Code taken from browser_main.cc. |
187 int pipefd[2]; | 187 int pipefd[2]; |
188 int ret = pipe(pipefd); | 188 int ret = pipe(pipefd); |
189 if (ret < 0) { | 189 if (ret < 0) { |
190 PLOG(DFATAL) << "Failed to create pipe"; | 190 PLOG(DFATAL) << "Failed to create pipe"; |
191 } else { | 191 } else { |
192 int shutdown_pipe_read_fd = pipefd[0]; | 192 int shutdown_pipe_read_fd = pipefd[0]; |
193 g_shutdown_pipe_write_fd = pipefd[1]; | 193 g_shutdown_pipe_write_fd = pipefd[1]; |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
292 pool->Recycle(); | 292 pool->Recycle(); |
293 TRACE_EVENT_BEGIN("RendererMain.START_MSG_LOOP", 0, 0); | 293 TRACE_EVENT_BEGIN("RendererMain.START_MSG_LOOP", 0, 0); |
294 MessageLoop::current()->Run(); | 294 MessageLoop::current()->Run(); |
295 TRACE_EVENT_END("RendererMain.START_MSG_LOOP", 0, 0); | 295 TRACE_EVENT_END("RendererMain.START_MSG_LOOP", 0, 0); |
296 } | 296 } |
297 } | 297 } |
298 platform.PlatformUninitialize(); | 298 platform.PlatformUninitialize(); |
299 TRACE_EVENT_END("RendererMain", 0, ""); | 299 TRACE_EVENT_END("RendererMain", 0, ""); |
300 return 0; | 300 return 0; |
301 } | 301 } |
OLD | NEW |