summaryrefslogtreecommitdiffstats
path: root/chrome/renderer/renderer_sandbox_support_linux.cc
diff options
context:
space:
mode:
Diffstat (limited to 'chrome/renderer/renderer_sandbox_support_linux.cc')
-rw-r--r--chrome/renderer/renderer_sandbox_support_linux.cc38
1 files changed, 38 insertions, 0 deletions
diff --git a/chrome/renderer/renderer_sandbox_support_linux.cc b/chrome/renderer/renderer_sandbox_support_linux.cc
index a08fff1..1c4a60d 100644
--- a/chrome/renderer/renderer_sandbox_support_linux.cc
+++ b/chrome/renderer/renderer_sandbox_support_linux.cc
@@ -10,6 +10,8 @@
#include "chrome/common/chrome_descriptors.h"
#include "chrome/common/sandbox_methods_linux.h"
+#include "third_party/WebKit/WebKit/chromium/public/linux/WebFontRenderStyle.h"
+
namespace renderer_sandbox_support {
std::string getFontFamilyForCharacters(const uint16_t* utf16, size_t num_utf16) {
@@ -35,4 +37,40 @@ std::string getFontFamilyForCharacters(const uint16_t* utf16, size_t num_utf16)
return family_name;
}
+void getRenderStyleForStrike(const char* family, int sizeAndStyle,
+ WebKit::WebFontRenderStyle* out) {
+ Pickle request;
+ request.WriteInt(LinuxSandbox::METHOD_GET_STYLE_FOR_STRIKE);
+ request.WriteString(family);
+ request.WriteInt(sizeAndStyle);
+
+ uint8_t buf[512];
+ const int sandbox_fd =
+ kSandboxIPCChannel + base::GlobalDescriptors::kBaseDescriptor;
+ const ssize_t n = base::SendRecvMsg(sandbox_fd, buf, sizeof(buf), NULL,
+ request);
+
+ out->setDefaults();
+ if (n == -1) {
+ return;
+ }
+
+ Pickle reply(reinterpret_cast<char*>(buf), n);
+ void* pickle_iter = NULL;
+ int useBitmaps, useAutoHint, useHinting, hintStyle, useAntiAlias, useSubpixel;
+ if (reply.ReadInt(&pickle_iter, &useBitmaps) &&
+ reply.ReadInt(&pickle_iter, &useAutoHint) &&
+ reply.ReadInt(&pickle_iter, &useHinting) &&
+ reply.ReadInt(&pickle_iter, &hintStyle) &&
+ reply.ReadInt(&pickle_iter, &useAntiAlias) &&
+ reply.ReadInt(&pickle_iter, &useSubpixel)) {
+ out->useBitmaps = useBitmaps;
+ out->useAutoHint = useAutoHint;
+ out->useHinting = useHinting;
+ out->hintStyle = hintStyle;
+ out->useAntiAlias = useAntiAlias;
+ out->useSubpixel = useSubpixel;
+ }
+}
+
} // namespace render_sandbox_support