Chromium Code Reviews| 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" |
| 11 #include "base/memory/ref_counted.h" | 11 #include "base/memory/ref_counted.h" |
| 12 #include "base/message_loop/message_loop.h" | 12 #include "base/message_loop/message_loop.h" |
| 13 #include "base/metrics/field_trial.h" | 13 #include "base/metrics/field_trial.h" |
| 14 #include "base/metrics/histogram.h" | 14 #include "base/metrics/histogram.h" |
| 15 #include "base/metrics/statistics_recorder.h" | 15 #include "base/metrics/statistics_recorder.h" |
| 16 #include "base/metrics/stats_counters.h" | 16 #include "base/metrics/stats_counters.h" |
| 17 #include "base/path_service.h" | 17 #include "base/path_service.h" |
| 18 #include "base/pending_task.h" | 18 #include "base/pending_task.h" |
| 19 #include "base/strings/string_util.h" | 19 #include "base/strings/string_util.h" |
| 20 #include "base/sys_utils.h" | |
| 20 #include "base/threading/platform_thread.h" | 21 #include "base/threading/platform_thread.h" |
| 21 #include "base/time/time.h" | 22 #include "base/time/time.h" |
| 22 #include "base/timer/hi_res_timer_manager.h" | 23 #include "base/timer/hi_res_timer_manager.h" |
| 23 #include "content/child/child_process.h" | 24 #include "content/child/child_process.h" |
| 24 #include "content/common/content_constants_internal.h" | 25 #include "content/common/content_constants_internal.h" |
| 25 #include "content/public/common/content_switches.h" | 26 #include "content/public/common/content_switches.h" |
| 26 #include "content/public/common/main_function_params.h" | 27 #include "content/public/common/main_function_params.h" |
| 27 #include "content/public/renderer/content_renderer_client.h" | 28 #include "content/public/renderer/content_renderer_client.h" |
| 28 #include "content/renderer/browser_plugin/browser_plugin_manager_impl.h" | 29 #include "content/renderer/browser_plugin/browser_plugin_manager_impl.h" |
| 29 #include "content/renderer/pepper/pepper_plugin_registry.h" | 30 #include "content/renderer/pepper/pepper_plugin_registry.h" |
| 30 #include "content/renderer/render_process_impl.h" | 31 #include "content/renderer/render_process_impl.h" |
| 31 #include "content/renderer/render_thread_impl.h" | 32 #include "content/renderer/render_thread_impl.h" |
| 32 #include "content/renderer/renderer_main_platform_delegate.h" | 33 #include "content/renderer/renderer_main_platform_delegate.h" |
| 33 #include "ui/base/ui_base_switches.h" | 34 #include "ui/base/ui_base_switches.h" |
| 35 #include "third_party/skia/include/core/SkGraphics.h" | |
| 34 #include "webkit/child/webkit_child_helpers.h" | 36 #include "webkit/child/webkit_child_helpers.h" |
| 35 | 37 |
| 36 #if defined(OS_ANDROID) | |
| 37 #include "base/android/sys_utils.h" | |
| 38 #include "third_party/skia/include/core/SkGraphics.h" | |
| 39 #endif // OS_ANDROID | |
| 40 | |
| 41 #if defined(OS_MACOSX) | 38 #if defined(OS_MACOSX) |
| 42 #include <Carbon/Carbon.h> | 39 #include <Carbon/Carbon.h> |
| 43 #include <signal.h> | 40 #include <signal.h> |
| 44 #include <unistd.h> | 41 #include <unistd.h> |
| 45 | 42 |
| 46 #include "base/mac/mac_util.h" | 43 #include "base/mac/mac_util.h" |
| 47 #include "base/mac/scoped_nsautorelease_pool.h" | 44 #include "base/mac/scoped_nsautorelease_pool.h" |
| 48 #include "third_party/WebKit/public/web/WebView.h" | 45 #include "third_party/WebKit/public/web/WebView.h" |
| 49 #endif // OS_MACOSX | 46 #endif // OS_MACOSX |
| 50 | 47 |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 130 // locale (at login time for Chrome OS), we have to set the ICU default | 127 // locale (at login time for Chrome OS), we have to set the ICU default |
| 131 // locale for renderer process here. | 128 // locale for renderer process here. |
| 132 // ICU locale will be used for fallback font selection etc. | 129 // ICU locale will be used for fallback font selection etc. |
| 133 if (parsed_command_line.HasSwitch(switches::kLang)) { | 130 if (parsed_command_line.HasSwitch(switches::kLang)) { |
| 134 const std::string locale = | 131 const std::string locale = |
| 135 parsed_command_line.GetSwitchValueASCII(switches::kLang); | 132 parsed_command_line.GetSwitchValueASCII(switches::kLang); |
| 136 base::i18n::SetICUDefaultLocale(locale); | 133 base::i18n::SetICUDefaultLocale(locale); |
| 137 } | 134 } |
| 138 #endif | 135 #endif |
| 139 | 136 |
| 140 #if defined(OS_ANDROID) | |
| 141 const int kMB = 1024 * 1024; | 137 const int kMB = 1024 * 1024; |
| 142 size_t font_cache_limit = | 138 size_t font_cache_limit = |
| 143 base::android::SysUtils::IsLowEndDevice() ? kMB : 8 * kMB; | 139 base::SysUtils::IsLowEndDevice() ? kMB : 8 * kMB; |
| 144 SkGraphics::SetFontCacheLimit(font_cache_limit); | 140 SkGraphics::SetFontCacheLimit(font_cache_limit); |
|
piman
2014/01/08 04:41:50
This changes behavior for non-low-end devices too.
ostap
2014/01/20 08:12:24
Done.
| |
| 145 #endif | |
| 146 | 141 |
| 147 // This function allows pausing execution using the --renderer-startup-dialog | 142 // This function allows pausing execution using the --renderer-startup-dialog |
| 148 // flag allowing us to attach a debugger. | 143 // flag allowing us to attach a debugger. |
| 149 // Do not move this function down since that would mean we can't easily debug | 144 // Do not move this function down since that would mean we can't easily debug |
| 150 // whatever occurs before it. | 145 // whatever occurs before it. |
| 151 HandleRendererErrorTestParameters(parsed_command_line); | 146 HandleRendererErrorTestParameters(parsed_command_line); |
| 152 | 147 |
| 153 RendererMainPlatformDelegate platform(parameters); | 148 RendererMainPlatformDelegate platform(parameters); |
| 154 | 149 |
| 155 | 150 |
| (...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 251 base::MessageLoop::current()->Run(); | 246 base::MessageLoop::current()->Run(); |
| 252 TRACE_EVENT_END_ETW("RendererMain.START_MSG_LOOP", 0, 0); | 247 TRACE_EVENT_END_ETW("RendererMain.START_MSG_LOOP", 0, 0); |
| 253 } | 248 } |
| 254 } | 249 } |
| 255 platform.PlatformUninitialize(); | 250 platform.PlatformUninitialize(); |
| 256 TRACE_EVENT_END_ETW("RendererMain", 0, ""); | 251 TRACE_EVENT_END_ETW("RendererMain", 0, ""); |
| 257 return 0; | 252 return 0; |
| 258 } | 253 } |
| 259 | 254 |
| 260 } // namespace content | 255 } // namespace content |
| OLD | NEW |