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

Unified Diff: chrome/renderer/renderer_webkitclient_impl.cc

Issue 132007: Linux: plumb fontconfig call out to the sandbox host. (Closed)
Patch Set: ... Created 11 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
« no previous file with comments | « chrome/renderer/renderer_webkitclient_impl.h ('k') | webkit/api/public/gtk/WebFontInfo.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/renderer/renderer_webkitclient_impl.cc
diff --git a/chrome/renderer/renderer_webkitclient_impl.cc b/chrome/renderer/renderer_webkitclient_impl.cc
index 408ddef21412c3c8e1cce01006b021961615c3ce..a1934477bdfb7b9b247a207be86c079b7162912a 100644
--- a/chrome/renderer/renderer_webkitclient_impl.cc
+++ b/chrome/renderer/renderer_webkitclient_impl.cc
@@ -16,6 +16,10 @@
#include "webkit/glue/glue_util.h"
#include "webkit/glue/webkit_glue.h"
+#if defined(OS_LINUX)
+#include "chrome/renderer/renderer_sandbox_support_linux.h"
+#endif
+
using WebKit::WebString;
using WebKit::WebURL;
@@ -30,7 +34,7 @@ WebKit::WebMimeRegistry* RendererWebKitClientImpl::mimeRegistry() {
}
WebKit::WebSandboxSupport* RendererWebKitClientImpl::sandboxSupport() {
-#if defined(OS_WIN)
+#if defined(OS_WIN) || defined(OS_LINUX)
return &sandbox_support_;
#else
return NULL;
@@ -139,4 +143,23 @@ bool RendererWebKitClientImpl::SandboxSupport::ensureFontLoaded(HFONT font) {
return RenderThread::current()->Send(new ViewHostMsg_LoadFont(logfont));
}
+#elif defined(OS_LINUX)
+
+WebString RendererWebKitClientImpl::SandboxSupport::getFontFamilyForCharacters(
+ const WebKit::WebUChar* characters, size_t num_characters) {
+ AutoLock lock(unicode_font_families_mutex_);
+ const std::string key(reinterpret_cast<const char*>(characters),
+ num_characters * sizeof(characters[0]));
+ const std::map<std::string, std::string>::const_iterator iter =
+ unicode_font_families_.find(key);
+ if (iter != unicode_font_families_.end())
+ return WebString::fromUTF8(iter->second.data(), iter->second.size());
+
+ const std::string family_name =
+ renderer_sandbox_support::getFontFamilyForCharacters(characters,
+ num_characters);
+ unicode_font_families_.insert(make_pair(key, family_name));
+ return WebString::fromUTF8(family_name);
+}
+
#endif
« no previous file with comments | « chrome/renderer/renderer_webkitclient_impl.h ('k') | webkit/api/public/gtk/WebFontInfo.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698