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 <stddef.h> | 5 #include <stddef.h> |
6 #include <utility> | 6 #include <utility> |
7 | 7 |
8 #include "base/base_switches.h" | 8 #include "base/base_switches.h" |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/debug/debugger.h" | 10 #include "base/debug/debugger.h" |
(...skipping 22 matching lines...) Expand all Loading... |
33 #include "media/media_features.h" | 33 #include "media/media_features.h" |
34 #include "ppapi/features/features.h" | 34 #include "ppapi/features/features.h" |
35 #include "third_party/WebKit/public/platform/scheduler/renderer/renderer_schedul
er.h" | 35 #include "third_party/WebKit/public/platform/scheduler/renderer/renderer_schedul
er.h" |
36 #include "third_party/skia/include/core/SkGraphics.h" | 36 #include "third_party/skia/include/core/SkGraphics.h" |
37 #include "ui/base/ui_base_switches.h" | 37 #include "ui/base/ui_base_switches.h" |
38 | 38 |
39 #if defined(OS_ANDROID) | 39 #if defined(OS_ANDROID) |
40 #include "base/android/library_loader/library_loader_hooks.h" | 40 #include "base/android/library_loader/library_loader_hooks.h" |
41 #endif // OS_ANDROID | 41 #endif // OS_ANDROID |
42 | 42 |
| 43 #if defined(OS_POSIX) && !defined(OS_MACOSX) && !defined(OS_ANDROID) |
| 44 #include "content/common/font_config_ipc_linux.h" |
| 45 #include "content/common/sandbox_linux/sandbox_linux.h" |
| 46 #include "third_party/skia/include/ports/SkFontConfigInterface.h" |
| 47 #endif |
| 48 |
43 #if defined(OS_MACOSX) | 49 #if defined(OS_MACOSX) |
44 #include <Carbon/Carbon.h> | 50 #include <Carbon/Carbon.h> |
45 #include <signal.h> | 51 #include <signal.h> |
46 #include <unistd.h> | 52 #include <unistd.h> |
47 | 53 |
48 #include "base/mac/scoped_nsautorelease_pool.h" | 54 #include "base/mac/scoped_nsautorelease_pool.h" |
49 #include "base/message_loop/message_pump_mac.h" | 55 #include "base/message_loop/message_pump_mac.h" |
50 #include "third_party/WebKit/public/web/WebView.h" | 56 #include "third_party/WebKit/public/web/WebView.h" |
51 #endif // OS_MACOSX | 57 #endif // OS_MACOSX |
52 | 58 |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
103 // locale (at login time for Chrome OS), we have to set the ICU default | 109 // locale (at login time for Chrome OS), we have to set the ICU default |
104 // locale for renderer process here. | 110 // locale for renderer process here. |
105 // ICU locale will be used for fallback font selection etc. | 111 // ICU locale will be used for fallback font selection etc. |
106 if (parsed_command_line.HasSwitch(switches::kLang)) { | 112 if (parsed_command_line.HasSwitch(switches::kLang)) { |
107 const std::string locale = | 113 const std::string locale = |
108 parsed_command_line.GetSwitchValueASCII(switches::kLang); | 114 parsed_command_line.GetSwitchValueASCII(switches::kLang); |
109 base::i18n::SetICUDefaultLocale(locale); | 115 base::i18n::SetICUDefaultLocale(locale); |
110 } | 116 } |
111 #endif | 117 #endif |
112 | 118 |
| 119 #if defined(OS_POSIX) && !defined(OS_MACOSX) && !defined(OS_ANDROID) |
| 120 // This call could already have been made from zygote_main_linux.cc. However |
| 121 // we need to do it here if Zygote is disabled. |
| 122 if (base::CommandLine::ForCurrentProcess()->HasSwitch(switches::kNoZygote)) { |
| 123 SkFontConfigInterface::SetGlobal(new FontConfigIPC(GetSandboxFD())) |
| 124 ->unref(); |
| 125 } |
| 126 #endif |
| 127 |
113 SkGraphics::Init(); | 128 SkGraphics::Init(); |
114 #if defined(OS_ANDROID) | 129 #if defined(OS_ANDROID) |
115 const int kMB = 1024 * 1024; | 130 const int kMB = 1024 * 1024; |
116 size_t font_cache_limit = | 131 size_t font_cache_limit = |
117 base::SysInfo::IsLowEndDevice() ? kMB : 8 * kMB; | 132 base::SysInfo::IsLowEndDevice() ? kMB : 8 * kMB; |
118 SkGraphics::SetFontCacheLimit(font_cache_limit); | 133 SkGraphics::SetFontCacheLimit(font_cache_limit); |
119 #endif | 134 #endif |
120 | 135 |
121 #if defined(USE_OZONE) | 136 #if defined(USE_OZONE) |
122 g_pixmap_factory.Get() = ui::CreateClientNativePixmapFactoryOzone(); | 137 g_pixmap_factory.Get() = ui::CreateClientNativePixmapFactoryOzone(); |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
206 // ignore shutdown-only leaks. | 221 // ignore shutdown-only leaks. |
207 __lsan_do_leak_check(); | 222 __lsan_do_leak_check(); |
208 #endif | 223 #endif |
209 } | 224 } |
210 platform.PlatformUninitialize(); | 225 platform.PlatformUninitialize(); |
211 TRACE_EVENT_ASYNC_END0("startup", "RendererMain", 0); | 226 TRACE_EVENT_ASYNC_END0("startup", "RendererMain", 0); |
212 return 0; | 227 return 0; |
213 } | 228 } |
214 | 229 |
215 } // namespace content | 230 } // namespace content |
OLD | NEW |