Update V8 to version 4.6.72.
[chromium-blink-merge.git] / content / common / font_cache_dispatcher_win.h
blob3c0faf8ad36984e4b2fd583d3841e0476767c4e8
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef CONTENT_COMMON_FONT_CACHE_DISPATCHER_WIN_H_
6 #define CONTENT_COMMON_FONT_CACHE_DISPATCHER_WIN_H_
8 #include <windows.h>
10 #include "base/basictypes.h"
11 #include "base/memory/singleton.h"
12 #include "ipc/ipc_sender.h"
13 #include "ipc/message_filter.h"
15 namespace content {
17 // Dispatches messages used for font caching on Windows. This is needed because
18 // Windows can't load fonts into its kernel cache in sandboxed processes. So the
19 // sandboxed process asks the browser process to do this for it.
20 class FontCacheDispatcher : public IPC::MessageFilter, public IPC::Sender {
21 public:
22 FontCacheDispatcher();
24 // IPC::Sender implementation:
25 bool Send(IPC::Message* message) override;
27 private:
28 ~FontCacheDispatcher() override;
30 // IPC::MessageFilter implementation:
31 void OnFilterAdded(IPC::Sender* sender) override;
32 bool OnMessageReceived(const IPC::Message& message) override;
33 void OnChannelClosing() override;
35 // Message handlers.
36 void OnPreCacheFont(const LOGFONT& font);
37 void OnReleaseCachedFonts();
39 IPC::Sender* sender_;
41 DISALLOW_COPY_AND_ASSIGN(FontCacheDispatcher);
44 } // namespace content
46 #endif // CONTENT_COMMON_FONT_CACHE_DISPATCHER_WIN_H_