diff options
author | arthurhsu@chromium.org <arthurhsu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-09-20 03:33:21 +0000 |
---|---|---|
committer | arthurhsu@chromium.org <arthurhsu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-09-20 03:33:21 +0000 |
commit | 79fff8227ab720a8bf309107ef96f57ae93592c1 (patch) | |
tree | cb9c7d286ece595404e5dde9ab381820017b40dc /content/browser | |
parent | f354e25b2905341d67166e20709a71163004de73 (diff) | |
download | chromium_src-79fff8227ab720a8bf309107ef96f57ae93592c1.zip chromium_src-79fff8227ab720a8bf309107ef96f57ae93592c1.tar.gz chromium_src-79fff8227ab720a8bf309107ef96f57ae93592c1.tar.bz2 |
New implementation of font precache on Windows.
BUG=94421
TEST=none
Review URL: http://codereview.chromium.org/7866019
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@101911 0039d316-1c4b-4281-b951-d872f2087c98
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, |