OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CONTENT_COMMON_FONT_CACHE_DISPATCHER_WIN_H_ | 5 #ifndef CONTENT_COMMON_FONT_CACHE_DISPATCHER_WIN_H_ |
6 #define CONTENT_COMMON_FONT_CACHE_DISPATCHER_WIN_H_ | 6 #define CONTENT_COMMON_FONT_CACHE_DISPATCHER_WIN_H_ |
7 | 7 |
8 #include <windows.h> | 8 #include <windows.h> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
11 #include "base/memory/singleton.h" | 11 #include "base/memory/singleton.h" |
12 #include "ipc/ipc_sender.h" | 12 #include "ipc/ipc_sender.h" |
13 #include "ipc/message_filter.h" | 13 #include "ipc/message_filter.h" |
14 | 14 |
15 namespace content { | 15 namespace content { |
16 | 16 |
17 // Dispatches messages used for font caching on Windows. This is needed because | 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 | 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. | 19 // sandboxed process asks the browser process to do this for it. |
20 class FontCacheDispatcher : public IPC::MessageFilter, public IPC::Sender { | 20 class FontCacheDispatcher : public IPC::MessageFilter, public IPC::Sender { |
21 public: | 21 public: |
22 FontCacheDispatcher(); | 22 FontCacheDispatcher(); |
23 ~FontCacheDispatcher() override; | |
24 | 23 |
25 // IPC::Sender implementation: | 24 // IPC::Sender implementation: |
26 bool Send(IPC::Message* message) override; | 25 bool Send(IPC::Message* message) override; |
27 | 26 |
28 private: | 27 private: |
| 28 ~FontCacheDispatcher() override; |
| 29 |
29 // IPC::MessageFilter implementation: | 30 // IPC::MessageFilter implementation: |
30 void OnFilterAdded(IPC::Sender* sender) override; | 31 void OnFilterAdded(IPC::Sender* sender) override; |
31 bool OnMessageReceived(const IPC::Message& message) override; | 32 bool OnMessageReceived(const IPC::Message& message) override; |
32 void OnChannelClosing() override; | 33 void OnChannelClosing() override; |
33 | 34 |
34 // Message handlers. | 35 // Message handlers. |
35 void OnPreCacheFont(const LOGFONT& font); | 36 void OnPreCacheFont(const LOGFONT& font); |
36 void OnReleaseCachedFonts(); | 37 void OnReleaseCachedFonts(); |
37 | 38 |
38 IPC::Sender* sender_; | 39 IPC::Sender* sender_; |
39 | 40 |
40 DISALLOW_COPY_AND_ASSIGN(FontCacheDispatcher); | 41 DISALLOW_COPY_AND_ASSIGN(FontCacheDispatcher); |
41 }; | 42 }; |
42 | 43 |
43 } // namespace content | 44 } // namespace content |
44 | 45 |
45 #endif // CONTENT_COMMON_FONT_CACHE_DISPATCHER_WIN_H_ | 46 #endif // CONTENT_COMMON_FONT_CACHE_DISPATCHER_WIN_H_ |
OLD | NEW |