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

Unified Diff: content/browser/renderer_host/render_message_filter.cc

Issue 7866019: New implementation of font precache on Windows. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Update for code review Created 9 years, 3 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/render_message_filter.cc
diff --git a/content/browser/renderer_host/render_message_filter.cc b/content/browser/renderer_host/render_message_filter.cc
index 25eb0d2aa4de77174c42b41f671ee933dcc350f5..d64b464b87c0e5fb32db95a8823c6b00b9df33cd 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

Powered by Google App Engine
This is Rietveld 408576698