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

Unified Diff: content/browser/renderer_host/pepper/content_browser_pepper_host_factory.cc

Issue 337203003: Move PPB_TrueTypeFont_Dev host from renderer to browser. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Check fd / HANDLE / FontRef for validity. 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/pepper/content_browser_pepper_host_factory.cc
diff --git a/content/browser/renderer_host/pepper/content_browser_pepper_host_factory.cc b/content/browser/renderer_host/pepper/content_browser_pepper_host_factory.cc
index e1ce0320b6e12e9bfe8d4749e4d67be2d9bb8063..65c33b0aa9311d799b97f1d7cce571d394c1adfc 100644
--- a/content/browser/renderer_host/pepper/content_browser_pepper_host_factory.cc
+++ b/content/browser/renderer_host/pepper/content_browser_pepper_host_factory.cc
@@ -18,6 +18,7 @@
#include "content/browser/renderer_host/pepper/pepper_printing_host.h"
#include "content/browser/renderer_host/pepper/pepper_tcp_server_socket_message_filter.h"
#include "content/browser/renderer_host/pepper/pepper_tcp_socket_message_filter.h"
+#include "content/browser/renderer_host/pepper/pepper_truetype_font_host.h"
#include "content/browser/renderer_host/pepper/pepper_truetype_font_list_host.h"
#include "content/browser/renderer_host/pepper/pepper_udp_socket_message_filter.h"
#include "ppapi/host/message_filter_host.h"
@@ -29,6 +30,7 @@
using ppapi::host::MessageFilterHost;
using ppapi::host::ResourceHost;
using ppapi::host::ResourceMessageFilter;
+using ppapi::proxy::SerializedTrueTypeFontDesc;
using ppapi::UnpackMessage;
namespace content {
@@ -140,6 +142,20 @@ scoped_ptr<ResourceHost> ContentBrowserPepperHostFactory::CreateResourceHost(
params.pp_resource(),
manager.Pass()));
}
+ case PpapiHostMsg_TrueTypeFont_Create::ID: {
+ SerializedTrueTypeFontDesc desc;
+ if (!UnpackMessage<PpapiHostMsg_TrueTypeFont_Create>(message, &desc)) {
+ NOTREACHED();
+ return scoped_ptr<ResourceHost>();
+ }
+ // Check that the family name is valid UTF-8 before passing it to the
+ // host OS.
+ if (!base::IsStringUTF8(desc.family))
+ return scoped_ptr<ResourceHost>();
+
+ return scoped_ptr<ResourceHost>(new PepperTrueTypeFontHost(
+ host_, instance, params.pp_resource(), desc));
+ }
case PpapiHostMsg_TrueTypeFontSingleton_Create::ID: {
return scoped_ptr<ResourceHost>(new PepperTrueTypeFontListHost(
host_, instance, params.pp_resource()));
« no previous file with comments | « content/browser/renderer_host/font_utils_linux.cc ('k') | content/browser/renderer_host/pepper/pepper_truetype_font.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698