Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2097)

Unified Diff: content/renderer/renderer_main.cc

Issue 2833973003: Initialize FontConfigIPC when zygote is disabled so font fallback works. (Closed)
Patch Set: Make test TSan clean. Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/browser/renderer_host/sandbox_ipc_linux.cc ('k') | content/test/BUILD.gn » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/renderer_main.cc
diff --git a/content/renderer/renderer_main.cc b/content/renderer/renderer_main.cc
index 99a42094feaa839659a7401c6339afd4f2903780..900958e3438168fc2c619b1f375778e8da60a323 100644
--- a/content/renderer/renderer_main.cc
+++ b/content/renderer/renderer_main.cc
@@ -40,6 +40,12 @@
#include "base/android/library_loader/library_loader_hooks.h"
#endif // OS_ANDROID
+#if defined(OS_POSIX) && !defined(OS_MACOSX) && !defined(OS_ANDROID)
+#include "content/common/font_config_ipc_linux.h"
+#include "content/common/sandbox_linux/sandbox_linux.h"
+#include "third_party/skia/include/ports/SkFontConfigInterface.h"
+#endif
+
#if defined(OS_MACOSX)
#include <Carbon/Carbon.h>
#include <signal.h>
@@ -110,6 +116,15 @@ int RendererMain(const MainFunctionParams& parameters) {
}
#endif
+#if defined(OS_POSIX) && !defined(OS_MACOSX) && !defined(OS_ANDROID)
+ // This call could already have been made from zygote_main_linux.cc. However
+ // we need to do it here if Zygote is disabled.
+ if (base::CommandLine::ForCurrentProcess()->HasSwitch(switches::kNoZygote)) {
+ SkFontConfigInterface::SetGlobal(new FontConfigIPC(GetSandboxFD()))
+ ->unref();
+ }
+#endif
+
SkGraphics::Init();
#if defined(OS_ANDROID)
const int kMB = 1024 * 1024;
« no previous file with comments | « content/browser/renderer_host/sandbox_ipc_linux.cc ('k') | content/test/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698