blob: e817c3dcc797bfada9110811ba8a13a0cc910949 [file] [log] [blame]
[email protected]f7867172012-07-11 07:04:071// Copyright (c) 2012 The Chromium Authors. All rights reserved.
[email protected]e35c9a82011-12-01 18:48:412// 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]e35c9a82011-12-01 18:48:417
8#include <windows.h>
9
avia9aa7a82015-12-25 03:06:3110#include "base/macros.h"
[email protected]e35c9a82011-12-01 18:48:4111#include "base/memory/singleton.h"
Nicholas Verne33a2d10d2017-11-28 00:18:2812#include "content/common/font_cache_win.mojom.h"
13
14namespace service_manager {
15struct BindSourceInfo;
16}
[email protected]74122042014-04-25 00:07:3017
[email protected]130757672012-10-24 00:26:1918namespace content {
19
[email protected]e35c9a82011-12-01 18:48:4120// 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 Verne33a2d10d2017-11-28 00:18:2823class FontCacheDispatcher : public mojom::FontCacheWin {
[email protected]e35c9a82011-12-01 18:48:4124 public:
25 FontCacheDispatcher();
thakisefa363a2015-05-02 01:28:4426 ~FontCacheDispatcher() override;
27
Nicholas Verne33a2d10d2017-11-28 00:18:2828 static void Create(mojom::FontCacheWinRequest request,
29 const service_manager::BindSourceInfo& source_info);
[email protected]e35c9a82011-12-01 18:48:4130
Nicholas Verne33a2d10d2017-11-28 00:18:2831 private:
32 // mojom::FontCacheWin
33 void PreCacheFont(const LOGFONT&) override;
34 void ReleaseCachedFonts() override;
[email protected]e35c9a82011-12-01 18:48:4135
36 DISALLOW_COPY_AND_ASSIGN(FontCacheDispatcher);
37};
38
[email protected]130757672012-10-24 00:26:1939} // namespace content
40
[email protected]e35c9a82011-12-01 18:48:4141#endif // CONTENT_COMMON_FONT_CACHE_DISPATCHER_WIN_H_