From 725056b71817b5b35c49bad39ddc44d7156c4086 Mon Sep 17 00:00:00 2001 From: "bbudge@chromium.org" Date: Sat, 16 Mar 2013 09:57:51 +0000 Subject: Add Pepper TrueType font API plumbing. Adds Font resource and host, font singleton resource and host. Adds PPAPI IPC messages to communicate with renderer and browser. Adds Browser process font listing helper class abstraction and impls for Windows, Mac, and Linux. Font family enumeration is done in the browser process and is a rework of the trusted BrowserFont API. Adds Renderer process font helper class abstraction and impl stubs. Font operations are done in the renderer process because of Linux sandbox restrictions. BUG=79375 Review URL: https://chromiumcodereview.appspot.com/12600019 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@188576 0039d316-1c4b-4281-b951-d872f2087c98 --- ppapi/proxy/truetype_font_singleton_resource.h | 55 ++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 ppapi/proxy/truetype_font_singleton_resource.h (limited to 'ppapi/proxy/truetype_font_singleton_resource.h') diff --git a/ppapi/proxy/truetype_font_singleton_resource.h b/ppapi/proxy/truetype_font_singleton_resource.h new file mode 100644 index 0000000..03c9c7d --- /dev/null +++ b/ppapi/proxy/truetype_font_singleton_resource.h @@ -0,0 +1,55 @@ +// Copyright (c) 2013 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef PPAPI_PROXY_TRUETYPE_FONT_SINGLETON_RESOURCE_H_ +#define PPAPI_PROXY_TRUETYPE_FONT_SINGLETON_RESOURCE_H_ + +#include +#include + +#include "ppapi/proxy/connection.h" +#include "ppapi/proxy/plugin_resource.h" +#include "ppapi/thunk/ppb_truetype_font_singleton_api.h" + +namespace ppapi { + +class TrackedCallback; + +namespace proxy { + +struct SerializedTrueTypeFontDescription; + +// This handles the singleton calls (that don't take a PP_Resource parameter) +// on the TrueType font interface. +class TrueTypeFontSingletonResource + : public PluginResource, + public thunk::PPB_TrueTypeFont_Singleton_API { + public: + TrueTypeFontSingletonResource(Connection connection, PP_Instance instance); + virtual ~TrueTypeFontSingletonResource(); + + // Resource override. + virtual thunk::PPB_TrueTypeFont_Singleton_API* + AsPPB_TrueTypeFont_Singleton_API() OVERRIDE; + + // thunk::PPB_TrueTypeFont_Singleton_API implementation. + virtual int32_t GetFontFamilies( + PP_Instance instance, + const PP_ArrayOutput& output, + const scoped_refptr& callback) OVERRIDE; + + private: + void OnPluginMsgGetFontFamiliesComplete( + scoped_refptr callback, + PP_ArrayOutput array_output, + const ResourceMessageReplyParams& params, + const std::vector& data); + + DISALLOW_COPY_AND_ASSIGN(TrueTypeFontSingletonResource); +}; + +} // namespace proxy +} // namespace ppapi + +#endif // PPAPI_PROXY_TRUETYPE_FONT_SINGLETON_RESOURCE_H_ -- cgit v1.1