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

Unified Diff: content/browser/renderer_host/sandbox_ipc_linux.cc

Issue 2833973003: Initialize FontConfigIPC when zygote is disabled so font fallback works. (Closed)
Patch Set: Add browser test. 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.h ('k') | content/renderer/renderer_main.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/renderer_host/sandbox_ipc_linux.cc
diff --git a/content/browser/renderer_host/sandbox_ipc_linux.cc b/content/browser/renderer_host/sandbox_ipc_linux.cc
index dad523f99acbaf95364f38e9177a2fd14d8ddeda..d42748b749665983797b01a91118f984596a2e3b 100644
--- a/content/browser/renderer_host/sandbox_ipc_linux.cc
+++ b/content/browser/renderer_host/sandbox_ipc_linux.cc
@@ -35,6 +35,8 @@ namespace content {
namespace {
+SandboxIPCHandler::TestObserver* g_test_observer = nullptr;
+
// Converts gfx::FontRenderParams::Hinting to WebFontRenderStyle::hintStyle.
// Returns an int for serialization, but the underlying Blink type is a char.
int ConvertHinting(gfx::FontRenderParams::Hinting hinting) {
@@ -66,6 +68,12 @@ int ConvertSubpixelRendering(
} // namespace
+// static
+void SandboxIPCHandler::SetObserverForTests(
+ SandboxIPCHandler::TestObserver* observer) {
+ g_test_observer = observer;
+}
+
SandboxIPCHandler::SandboxIPCHandler(int lifeline_fd, int browser_socket)
: lifeline_fd_(lifeline_fd),
browser_socket_(browser_socket) {
@@ -216,6 +224,8 @@ void SandboxIPCHandler::HandleFontOpenRequest(
return;
if (index >= static_cast<uint32_t>(paths_.size()))
return;
+ if (g_test_observer)
+ g_test_observer->OnFontOpen(index);
const int result_fd = open(paths_[index].c_str(), O_RDONLY);
base::Pickle reply;
@@ -250,6 +260,9 @@ void SandboxIPCHandler::HandleGetFallbackFontForChar(
int fontconfig_interface_id =
FindOrAddPath(SkString(fallback_font.filename.data()));
+ if (g_test_observer)
Sami 2017/05/15 11:14:37 nit: Please add curly braces
+ g_test_observer->OnGetFallbackFontForChar(c, fallback_font.name,
+ fontconfig_interface_id);
base::Pickle reply;
reply.WriteString(fallback_font.name);
reply.WriteString(fallback_font.filename);
« no previous file with comments | « content/browser/renderer_host/sandbox_ipc_linux.h ('k') | content/renderer/renderer_main.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698