diff options
Diffstat (limited to 'content/browser')
-rw-r--r-- | content/browser/renderer_host/render_message_filter.cc | 17 | ||||
-rw-r--r-- | content/browser/renderer_host/render_message_filter.h | 6 |
2 files changed, 21 insertions, 2 deletions
diff --git a/content/browser/renderer_host/render_message_filter.cc b/content/browser/renderer_host/render_message_filter.cc index 25eb0d2..d64b464 100644 --- a/content/browser/renderer_host/render_message_filter.cc +++ b/content/browser/renderer_host/render_message_filter.cc @@ -64,6 +64,7 @@ #endif #if defined(OS_WIN) #include "content/common/child_process_host.h" +#include "content/common/child_process_messages.h" #endif using net::CookieStore; @@ -285,6 +286,12 @@ void RenderMessageFilter::OnChannelClosing() { plugin_host_clients_.clear(); } +#if defined (OS_WIN) +void RenderMessageFilter::OnChannelError() { + ChildProcessHost::ReleaseCachedFonts(render_process_id_); +} +#endif + void RenderMessageFilter::OverrideThreadForMessage(const IPC::Message& message, BrowserThread::ID* thread) { switch (message.type()) { @@ -313,7 +320,9 @@ bool RenderMessageFilter::OnMessageReceived(const IPC::Message& message, IPC_MESSAGE_HANDLER(ViewHostMsg_GetRootWindowRect, OnGetRootWindowRect) // This hack is Windows-specific. - IPC_MESSAGE_HANDLER(ViewHostMsg_PreCacheFont, OnPreCacheFont) + IPC_MESSAGE_HANDLER(ChildProcessHostMsg_PreCacheFont, OnPreCacheFont) + IPC_MESSAGE_HANDLER(ChildProcessHostMsg_ReleaseCachedFonts, + OnReleaseCachedFonts) #endif IPC_MESSAGE_HANDLER(ViewHostMsg_GenerateRoutingID, OnGenerateRoutingID) @@ -494,7 +503,11 @@ void RenderMessageFilter::OnLoadFont(const FontDescriptor& font, #if defined(OS_WIN) // This hack is Windows-specific. void RenderMessageFilter::OnPreCacheFont(const LOGFONT& font) { - ChildProcessHost::PreCacheFont(font); + ChildProcessHost::PreCacheFont(font, render_process_id_); +} + +void RenderMessageFilter::OnReleaseCachedFonts() { + ChildProcessHost::ReleaseCachedFonts(render_process_id_); } #endif // OS_WIN diff --git a/content/browser/renderer_host/render_message_filter.h b/content/browser/renderer_host/render_message_filter.h index 70a0d8f..4079134 100644 --- a/content/browser/renderer_host/render_message_filter.h +++ b/content/browser/renderer_host/render_message_filter.h @@ -78,6 +78,9 @@ class RenderMessageFilter : public BrowserMessageFilter { // IPC::ChannelProxy::MessageFilter methods: virtual void OnChannelClosing() OVERRIDE; +#if defined (OS_WIN) + virtual void OnChannelError() OVERRIDE; +#endif // BrowserMessageFilter methods: virtual void OverrideThreadForMessage(const IPC::Message& message, @@ -148,6 +151,9 @@ class RenderMessageFilter : public BrowserMessageFilter { // Cache fonts for the renderer. See RenderMessageFilter::OnPreCacheFont // implementation for more details. void OnPreCacheFont(const LOGFONT& font); + + // Release fonts cached for renderer. + void OnReleaseCachedFonts(); #endif void OnGetPlugins(bool refresh, |