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

Unified Diff: content/common/child_process_sandbox_support_impl_linux.cc

Issue 8590028: Use new getFontFamilyForCharacters() API. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 1 month 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/common/child_process_sandbox_support_impl_linux.cc
diff --git a/content/common/child_process_sandbox_support_impl_linux.cc b/content/common/child_process_sandbox_support_impl_linux.cc
index 692d4edfc04500e949c4cf06f0299e1e765834bd..46d08917c3e17e7d7d75a6f2e3135f0ce66b5736 100644
--- a/content/common/child_process_sandbox_support_impl_linux.cc
+++ b/content/common/child_process_sandbox_support_impl_linux.cc
@@ -13,6 +13,7 @@
#include "content/common/chrome_descriptors.h"
#include "content/common/sandbox_methods_linux.h"
#include "content/common/unix_domain_socket_posix.h"
+#include "third_party/WebKit/Source/WebKit/chromium/public/linux/WebFontFamily.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/linux/WebFontRenderStyle.h"
static int GetSandboxFD() {
@@ -21,9 +22,10 @@ static int GetSandboxFD() {
namespace content {
-std::string GetFontFamilyForCharacters(const uint16_t* utf16,
- size_t num_utf16,
- const char* preferred_locale) {
+void GetFontFamilyForCharacters(const uint16_t* utf16,
+ size_t num_utf16,
+ const char* preferred_locale,
+ WebKit::WebFontFamily* family) {
Pickle request;
request.WriteInt(LinuxSandbox::METHOD_GET_FONT_FAMILY_FOR_CHARS);
request.WriteInt(num_utf16);
@@ -36,13 +38,19 @@ std::string GetFontFamilyForCharacters(const uint16_t* utf16,
sizeof(buf), NULL, request);
std::string family_name;
+ bool isBold = false;
+ bool isItalic = false;
if (n != -1) {
Pickle reply(reinterpret_cast<char*>(buf), n);
void* pickle_iter = NULL;
- reply.ReadString(&pickle_iter, &family_name);
+ if (reply.ReadString(&pickle_iter, &family_name) &&
+ reply.ReadBool(&pickle_iter, &isBold) &&
+ reply.ReadBool(&pickle_iter, &isItalic)) {
+ family->name = family_name;
+ family->isBold = isBold;
+ family->isItalic = isItalic;
+ }
}
-
- return family_name;
}
void GetRenderStyleForStrike(const char* family, int sizeAndStyle,
« no previous file with comments | « content/common/child_process_sandbox_support_impl_linux.h ('k') | content/ppapi_plugin/ppapi_webkitplatformsupport_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698