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

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

Issue 327633002: Introduce WebFallbackFont on the Chromium side (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix missing rename in DEPS file Created 6 years, 6 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
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 fbf875940d9de3ae908e06526aa9ec8a57a078aa..7598bdbcc13861893150a1f41ebecb32552893b0 100644
--- a/content/browser/renderer_host/sandbox_ipc_linux.cc
+++ b/content/browser/renderer_host/sandbox_ipc_linux.cc
@@ -219,8 +219,8 @@ void SandboxIPCHandler::HandleRequestFromRenderer(int fd) {
HandleFontMatchRequest(fd, pickle, iter, fds.get());
} else if (kind == FontConfigIPC::METHOD_OPEN) {
HandleFontOpenRequest(fd, pickle, iter, fds.get());
- } else if (kind == LinuxSandbox::METHOD_GET_FONT_FAMILY_FOR_CHAR) {
- HandleGetFontFamilyForChar(fd, pickle, iter, fds.get());
+ } else if (kind == LinuxSandbox::METHOD_GET_FALLBACK_FONT_FOR_CHAR) {
+ HandleGetFallbackFontForChar(fd, pickle, iter, fds.get());
} else if (kind == LinuxSandbox::METHOD_LOCALTIME) {
HandleLocaltime(fd, pickle, iter, fds.get());
} else if (kind == LinuxSandbox::METHOD_GET_STYLE_FOR_STRIKE) {
@@ -311,7 +311,7 @@ void SandboxIPCHandler::HandleFontOpenRequest(
}
}
-void SandboxIPCHandler::HandleGetFontFamilyForChar(
+void SandboxIPCHandler::HandleGetFallbackFontForChar(
int fd,
const Pickle& pickle,
PickleIterator iter,
@@ -328,17 +328,23 @@ void SandboxIPCHandler::HandleGetFontFamilyForChar(
if (!pickle.ReadString(&iter, &preferred_locale))
return;
- blink::WebFontFamily family;
- WebFontInfo::familyForChar(c, preferred_locale.c_str(), &family);
+ blink::WebFallbackFont fallbackFont;
+ WebFontInfo::fallbackFontForChar(c, preferred_locale.c_str(), &fallbackFont);
Pickle reply;
- if (family.name.data()) {
- reply.WriteString(family.name.data());
+ if (fallbackFont.name.data()) {
+ reply.WriteString(fallbackFont.name.data());
} else {
reply.WriteString(std::string());
}
- reply.WriteBool(family.isBold);
- reply.WriteBool(family.isItalic);
+ if (fallbackFont.filename.data()) {
+ reply.WriteString(fallbackFont.filename.data());
+ } else {
+ reply.WriteString(std::string());
+ }
+ reply.WriteInt(fallbackFont.ttcIndex);
+ reply.WriteBool(fallbackFont.isBold);
+ reply.WriteBool(fallbackFont.isItalic);
SendRendererReply(fds, reply, -1);
}

Powered by Google App Engine
This is Rietveld 408576698