[email protected] | f786717 | 2012-07-11 07:04:07 | [diff] [blame] | 1 | // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
[email protected] | e35c9a8 | 2011-12-01 18:48:41 | [diff] [blame] | 2 | // Use of this source code is governed by a BSD-style license that can be |
3 | // found in the LICENSE file. | ||||
4 | |||||
5 | #ifndef CONTENT_COMMON_FONT_CACHE_DISPATCHER_WIN_H_ | ||||
6 | #define CONTENT_COMMON_FONT_CACHE_DISPATCHER_WIN_H_ | ||||
[email protected] | e35c9a8 | 2011-12-01 18:48:41 | [diff] [blame] | 7 | |
8 | #include <windows.h> | ||||
9 | |||||
avi | a9aa7a8 | 2015-12-25 03:06:31 | [diff] [blame] | 10 | #include "base/macros.h" |
[email protected] | e35c9a8 | 2011-12-01 18:48:41 | [diff] [blame] | 11 | #include "base/memory/singleton.h" |
Nicholas Verne | 33a2d10d | 2017-11-28 00:18:28 | [diff] [blame] | 12 | #include "content/common/font_cache_win.mojom.h" |
13 | |||||
14 | namespace service_manager { | ||||
15 | struct BindSourceInfo; | ||||
16 | } | ||||
[email protected] | 7412204 | 2014-04-25 00:07:30 | [diff] [blame] | 17 | |
[email protected] | 13075767 | 2012-10-24 00:26:19 | [diff] [blame] | 18 | namespace content { |
19 | |||||
[email protected] | e35c9a8 | 2011-12-01 18:48:41 | [diff] [blame] | 20 | // Dispatches messages used for font caching on Windows. This is needed because |
21 | // Windows can't load fonts into its kernel cache in sandboxed processes. So the | ||||
22 | // sandboxed process asks the browser process to do this for it. | ||||
Nicholas Verne | 33a2d10d | 2017-11-28 00:18:28 | [diff] [blame] | 23 | class FontCacheDispatcher : public mojom::FontCacheWin { |
[email protected] | e35c9a8 | 2011-12-01 18:48:41 | [diff] [blame] | 24 | public: |
25 | FontCacheDispatcher(); | ||||
thakis | efa363a | 2015-05-02 01:28:44 | [diff] [blame] | 26 | ~FontCacheDispatcher() override; |
27 | |||||
Nicholas Verne | 33a2d10d | 2017-11-28 00:18:28 | [diff] [blame] | 28 | static void Create(mojom::FontCacheWinRequest request, |
29 | const service_manager::BindSourceInfo& source_info); | ||||
[email protected] | e35c9a8 | 2011-12-01 18:48:41 | [diff] [blame] | 30 | |
Nicholas Verne | 33a2d10d | 2017-11-28 00:18:28 | [diff] [blame] | 31 | private: |
32 | // mojom::FontCacheWin | ||||
33 | void PreCacheFont(const LOGFONT&) override; | ||||
34 | void ReleaseCachedFonts() override; | ||||
[email protected] | e35c9a8 | 2011-12-01 18:48:41 | [diff] [blame] | 35 | |
36 | DISALLOW_COPY_AND_ASSIGN(FontCacheDispatcher); | ||||
37 | }; | ||||
38 | |||||
[email protected] | 13075767 | 2012-10-24 00:26:19 | [diff] [blame] | 39 | } // namespace content |
40 | |||||
[email protected] | e35c9a8 | 2011-12-01 18:48:41 | [diff] [blame] | 41 | #endif // CONTENT_COMMON_FONT_CACHE_DISPATCHER_WIN_H_ |