| 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 #include "base/command_line.h" | 5 #include "base/command_line.h" |
| 6 #include "base/debug/trace_event.h" | 6 #include "base/debug/trace_event.h" |
| 7 #include "base/i18n/rtl.h" | 7 #include "base/i18n/rtl.h" |
| 8 #include "base/mac/scoped_nsautorelease_pool.h" | 8 #include "base/mac/scoped_nsautorelease_pool.h" |
| 9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
| 10 #include "base/metrics/field_trial.h" | 10 #include "base/metrics/field_trial.h" |
| (...skipping 15 matching lines...) Expand all Loading... |
| 26 #include "content/renderer/render_thread.h" | 26 #include "content/renderer/render_thread.h" |
| 27 #include "content/renderer/renderer_main_platform_delegate.h" | 27 #include "content/renderer/renderer_main_platform_delegate.h" |
| 28 #include "ui/base/ui_base_switches.h" | 28 #include "ui/base/ui_base_switches.h" |
| 29 | 29 |
| 30 #if defined(OS_MACOSX) | 30 #if defined(OS_MACOSX) |
| 31 #include <Carbon/Carbon.h> | 31 #include <Carbon/Carbon.h> |
| 32 #include <signal.h> | 32 #include <signal.h> |
| 33 #include <unistd.h> | 33 #include <unistd.h> |
| 34 | 34 |
| 35 #include "base/mac/mac_util.h" | 35 #include "base/mac/mac_util.h" |
| 36 #include "base/mac/scoped_smooth_scrolling_disabler_mac.h" |
| 36 #include "third_party/mach_override/mach_override.h" | 37 #include "third_party/mach_override/mach_override.h" |
| 37 #include "third_party/WebKit/Source/WebKit/chromium/public/WebView.h" | 38 #include "third_party/WebKit/Source/WebKit/chromium/public/WebView.h" |
| 38 #endif // OS_MACOSX | 39 #endif // OS_MACOSX |
| 39 | 40 |
| 40 #if defined(OS_MACOSX) | 41 #if defined(OS_MACOSX) |
| 41 namespace { | 42 namespace { |
| 42 | 43 |
| 43 CFArrayRef ChromeTISCreateInputSourceList( | 44 CFArrayRef ChromeTISCreateInputSourceList( |
| 44 CFDictionaryRef properties, | 45 CFDictionaryRef properties, |
| 45 Boolean includeAllInstalled) { | 46 Boolean includeAllInstalled) { |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 122 | 123 |
| 123 // mainline routine for running as the Renderer process | 124 // mainline routine for running as the Renderer process |
| 124 int RendererMain(const MainFunctionParams& parameters) { | 125 int RendererMain(const MainFunctionParams& parameters) { |
| 125 TRACE_EVENT_BEGIN_ETW("RendererMain", 0, ""); | 126 TRACE_EVENT_BEGIN_ETW("RendererMain", 0, ""); |
| 126 | 127 |
| 127 const CommandLine& parsed_command_line = parameters.command_line_; | 128 const CommandLine& parsed_command_line = parameters.command_line_; |
| 128 base::mac::ScopedNSAutoreleasePool* pool = parameters.autorelease_pool_; | 129 base::mac::ScopedNSAutoreleasePool* pool = parameters.autorelease_pool_; |
| 129 | 130 |
| 130 #if defined(OS_MACOSX) | 131 #if defined(OS_MACOSX) |
| 131 InstallFrameworkHacks(); | 132 InstallFrameworkHacks(); |
| 133 |
| 134 base::ScopedSmoothScrollingDisabler disable_smooth_scrolling( |
| 135 parsed_command_line.HasSwitch( |
| 136 switches::kDisableMacSmoothScrollingForTesting)); |
| 132 #endif // OS_MACOSX | 137 #endif // OS_MACOSX |
| 133 | 138 |
| 134 #if defined(OS_CHROMEOS) | 139 #if defined(OS_CHROMEOS) |
| 135 // As Zygote process starts up earlier than browser process gets its own | 140 // As Zygote process starts up earlier than browser process gets its own |
| 136 // locale (at login time for Chrome OS), we have to set the ICU default | 141 // locale (at login time for Chrome OS), we have to set the ICU default |
| 137 // locale for renderer process here. | 142 // locale for renderer process here. |
| 138 // ICU locale will be used for fallback font selection etc. | 143 // ICU locale will be used for fallback font selection etc. |
| 139 if (parsed_command_line.HasSwitch(switches::kLang)) { | 144 if (parsed_command_line.HasSwitch(switches::kLang)) { |
| 140 const std::string locale = | 145 const std::string locale = |
| 141 parsed_command_line.GetSwitchValueASCII(switches::kLang); | 146 parsed_command_line.GetSwitchValueASCII(switches::kLang); |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 226 pool->Recycle(); | 231 pool->Recycle(); |
| 227 TRACE_EVENT_BEGIN_ETW("RendererMain.START_MSG_LOOP", 0, 0); | 232 TRACE_EVENT_BEGIN_ETW("RendererMain.START_MSG_LOOP", 0, 0); |
| 228 MessageLoop::current()->Run(); | 233 MessageLoop::current()->Run(); |
| 229 TRACE_EVENT_END_ETW("RendererMain.START_MSG_LOOP", 0, 0); | 234 TRACE_EVENT_END_ETW("RendererMain.START_MSG_LOOP", 0, 0); |
| 230 } | 235 } |
| 231 } | 236 } |
| 232 platform.PlatformUninitialize(); | 237 platform.PlatformUninitialize(); |
| 233 TRACE_EVENT_END_ETW("RendererMain", 0, ""); | 238 TRACE_EVENT_END_ETW("RendererMain", 0, ""); |
| 234 return 0; | 239 return 0; |
| 235 } | 240 } |
| OLD | NEW |