diff options
author | brettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-12-20 19:18:45 +0000 |
---|---|---|
committer | brettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-12-20 19:18:45 +0000 |
commit | 6fc87e0160e55c5ea05ea7f9834a146598685458 (patch) | |
tree | c5d2d6987e4ab9fe5710cc965a95b2e993141086 /content/ppapi_plugin | |
parent | b31580d250c3813b99fdd88a03e27d07fca9e236 (diff) | |
download | chromium_src-6fc87e0160e55c5ea05ea7f9834a146598685458.zip chromium_src-6fc87e0160e55c5ea05ea7f9834a146598685458.tar.gz chromium_src-6fc87e0160e55c5ea05ea7f9834a146598685458.tar.bz2 |
Hook up the PPB_Flash.PreloadFontWin function to our font loading infrastructure.
TEST=manual
Review URL: http://codereview.chromium.org/8979002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@115158 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/ppapi_plugin')
-rw-r--r-- | content/ppapi_plugin/ppapi_thread.cc | 12 | ||||
-rw-r--r-- | content/ppapi_plugin/ppapi_thread.h | 17 |
2 files changed, 23 insertions, 6 deletions
diff --git a/content/ppapi_plugin/ppapi_thread.cc b/content/ppapi_plugin/ppapi_thread.cc index 0d16f9a..31c8275 100644 --- a/content/ppapi_plugin/ppapi_thread.cc +++ b/content/ppapi_plugin/ppapi_thread.cc @@ -11,6 +11,7 @@ #include "base/rand_util.h" #include "base/stringprintf.h" #include "content/common/child_process.h" +#include "content/common/child_process_messages.h" #include "content/ppapi_plugin/broker_process_dispatcher.h" #include "content/ppapi_plugin/plugin_process_dispatcher.h" #include "content/ppapi_plugin/ppapi_webkit_thread.h" @@ -21,6 +22,7 @@ #include "ppapi/c/dev/ppp_network_state_dev.h" #include "ppapi/c/pp_errors.h" #include "ppapi/c/ppp.h" +#include "ppapi/proxy/plugin_globals.h" #include "ppapi/proxy/ppapi_messages.h" #include "ppapi/proxy/interface_list.h" #include "webkit/plugins/ppapi/webkit_forwarding_impl.h" @@ -47,9 +49,12 @@ PpapiThread::PpapiThread(bool is_broker) local_pp_module_( base::RandInt(0, std::numeric_limits<PP_Module>::max())), next_plugin_dispatcher_id_(1) { + ppapi::proxy::PluginGlobals::Get()->set_plugin_proxy_delegate(this); } PpapiThread::~PpapiThread() { + ppapi::proxy::PluginGlobals::Get()->set_plugin_proxy_delegate(NULL); + if (!library_.is_valid()) return; @@ -123,6 +128,13 @@ bool PpapiThread::SendToBrowser(IPC::Message* msg) { return Send(msg); } +void PpapiThread::PreCacheFont(const void* logfontw) { +#if defined(OS_WIN) + Send(new ChildProcessHostMsg_PreCacheFont( + *static_cast<const LOGFONTW*>(logfontw))); +#endif +} + uint32 PpapiThread::Register(ppapi::proxy::PluginDispatcher* plugin_dispatcher) { if (!plugin_dispatcher || plugin_dispatchers_.size() >= std::numeric_limits<uint32>::max()) { diff --git a/content/ppapi_plugin/ppapi_thread.h b/content/ppapi_plugin/ppapi_thread.h index 430e168..56e12c5 100644 --- a/content/ppapi_plugin/ppapi_thread.h +++ b/content/ppapi_plugin/ppapi_thread.h @@ -19,6 +19,7 @@ #include "ppapi/c/trusted/ppp_broker.h" #include "ppapi/proxy/plugin_dispatcher.h" #include "ppapi/proxy/plugin_globals.h" +#include "ppapi/proxy/plugin_proxy_delegate.h" class FilePath; class PpapiWebKitThread; @@ -28,7 +29,8 @@ struct ChannelHandle; } class PpapiThread : public ChildThread, - public ppapi::proxy::PluginDispatcher::PluginDelegate { + public ppapi::proxy::PluginDispatcher::PluginDelegate, + public ppapi::proxy::PluginProxyDelegate { public: explicit PpapiThread(bool is_broker); virtual ~PpapiThread(); @@ -37,17 +39,20 @@ class PpapiThread : public ChildThread, // ChildThread overrides. virtual bool OnMessageReceived(const IPC::Message& msg) OVERRIDE; - // Dispatcher::Delegate implementation. + // PluginDispatcher::PluginDelegate implementation. + virtual std::set<PP_Instance>* GetGloballySeenInstanceIDSet() OVERRIDE; virtual base::MessageLoopProxy* GetIPCMessageLoop() OVERRIDE; virtual base::WaitableEvent* GetShutdownEvent() OVERRIDE; - virtual std::set<PP_Instance>* GetGloballySeenInstanceIDSet() OVERRIDE; + virtual uint32 Register( + ppapi::proxy::PluginDispatcher* plugin_dispatcher) OVERRIDE; + virtual void Unregister(uint32 plugin_dispatcher_id) OVERRIDE; + + // PluginProxyDelegate. virtual ppapi::WebKitForwarding* GetWebKitForwarding() OVERRIDE; virtual void PostToWebKitThread(const tracked_objects::Location& from_here, const base::Closure& task) OVERRIDE; virtual bool SendToBrowser(IPC::Message* msg) OVERRIDE; - virtual uint32 Register( - ppapi::proxy::PluginDispatcher* plugin_dispatcher) OVERRIDE; - virtual void Unregister(uint32 plugin_dispatcher_id) OVERRIDE; + virtual void PreCacheFont(const void* logfontw) OVERRIDE; // Message handlers. void OnMsgLoadPlugin(const FilePath& path); |