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

Unified Diff: content/common/font_cache_dispatcher_win.h

Issue 8759013: Dispatch the Windows font caching IPCs in one filter. This avoids having the code that calls thos... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 1 month 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
« no previous file with comments | « content/common/child_process_host.cc ('k') | content/common/font_cache_dispatcher_win.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/common/font_cache_dispatcher_win.h
===================================================================
--- content/common/font_cache_dispatcher_win.h (revision 0)
+++ content/common/font_cache_dispatcher_win.h (revision 0)
@@ -0,0 +1,42 @@
+// Copyright (c) 2011 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 CONTENT_COMMON_FONT_CACHE_DISPATCHER_WIN_H_
+#define CONTENT_COMMON_FONT_CACHE_DISPATCHER_WIN_H_
+#pragma once
+
+#include <windows.h>
+
+#include "base/basictypes.h"
+#include "base/memory/singleton.h"
+#include "ipc/ipc_channel_proxy.h"
+
+// Dispatches messages used for font caching on Windows. This is needed because
+// Windows can't load fonts into its kernel cache in sandboxed processes. So the
+// sandboxed process asks the browser process to do this for it.
+class FontCacheDispatcher : public IPC::ChannelProxy::MessageFilter,
+ public IPC::Message::Sender {
+ public:
+ FontCacheDispatcher();
+ virtual ~FontCacheDispatcher();
+
+ // IPC::Message::Sender implementation:
+ virtual bool Send(IPC::Message* message) OVERRIDE;
+
+ private:
+ // IPC::ChannelProxy::MessageFilter implementation:
+ virtual void OnFilterAdded(IPC::Channel* channel) OVERRIDE;
+ virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE;
+ virtual void OnChannelClosing() OVERRIDE;
+
+ // Message handlers.
+ void OnPreCacheFont(const LOGFONT& font);
+ void OnReleaseCachedFonts();
+
+ IPC::Channel* channel_;
+
+ DISALLOW_COPY_AND_ASSIGN(FontCacheDispatcher);
+};
+
+#endif // CONTENT_COMMON_FONT_CACHE_DISPATCHER_WIN_H_
Property changes on: content\common\font_cache_dispatcher_win.h
___________________________________________________________________
Added: svn:eol-style
+ LF
« no previous file with comments | « content/common/child_process_host.cc ('k') | content/common/font_cache_dispatcher_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698