[email protected] | f786717 | 2012-07-11 07:04:07 | [diff] [blame] | 1 | // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
[email protected] | cf3ac397 | 2010-12-22 20:02:29 | [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 | |||||
[email protected] | 797c355 | 2011-03-17 00:26:18 | [diff] [blame] | 5 | #ifndef CONTENT_COMMON_FONT_CONFIG_IPC_LINUX_H_ |
6 | #define CONTENT_COMMON_FONT_CONFIG_IPC_LINUX_H_ | ||||
[email protected] | cf3ac397 | 2010-12-22 20:02:29 | [diff] [blame] | 7 | |
[email protected] | 5d536b8 | 2011-11-28 20:00:01 | [diff] [blame] | 8 | #include "base/compiler_specific.h" |
[email protected] | 9628e0d | 2013-03-12 13:11:54 | [diff] [blame] | 9 | #include "third_party/skia/include/ports/SkFontConfigInterface.h" |
[email protected] | cf3ac397 | 2010-12-22 20:02:29 | [diff] [blame] | 10 | |
11 | #include <string> | ||||
12 | |||||
[email protected] | 13075767 | 2012-10-24 00:26:19 | [diff] [blame] | 13 | namespace content { |
14 | |||||
[email protected] | cf3ac397 | 2010-12-22 20:02:29 | [diff] [blame] | 15 | // FontConfig implementation for Skia that proxies out of process to get out |
16 | // of the sandbox. See http://code.google.com/p/chromium/wiki/LinuxSandboxIPC | ||||
[email protected] | 9628e0d | 2013-03-12 13:11:54 | [diff] [blame] | 17 | class FontConfigIPC : public SkFontConfigInterface { |
[email protected] | cf3ac397 | 2010-12-22 20:02:29 | [diff] [blame] | 18 | public: |
19 | explicit FontConfigIPC(int fd); | ||||
[email protected] | 3690ebe0 | 2011-05-25 09:08:19 | [diff] [blame] | 20 | virtual ~FontConfigIPC(); |
[email protected] | cf3ac397 | 2010-12-22 20:02:29 | [diff] [blame] | 21 | |
[email protected] | 9628e0d | 2013-03-12 13:11:54 | [diff] [blame] | 22 | virtual bool matchFamilyName(const char familyName[], |
23 | SkTypeface::Style requested, | ||||
24 | FontIdentity* outFontIdentifier, | ||||
25 | SkString* outFamilyName, | ||||
26 | SkTypeface::Style* outStyle) OVERRIDE; | ||||
27 | |||||
28 | virtual SkStream* openStream(const FontIdentity&) OVERRIDE; | ||||
[email protected] | cf3ac397 | 2010-12-22 20:02:29 | [diff] [blame] | 29 | |
30 | enum Method { | ||||
31 | METHOD_MATCH = 0, | ||||
32 | METHOD_OPEN = 1, | ||||
33 | }; | ||||
34 | |||||
[email protected] | 9628e0d | 2013-03-12 13:11:54 | [diff] [blame] | 35 | enum { |
36 | kMaxFontFamilyLength = 2048 | ||||
37 | }; | ||||
38 | |||||
[email protected] | cf3ac397 | 2010-12-22 20:02:29 | [diff] [blame] | 39 | private: |
40 | const int fd_; | ||||
41 | }; | ||||
42 | |||||
[email protected] | 13075767 | 2012-10-24 00:26:19 | [diff] [blame] | 43 | } // namespace content |
44 | |||||
[email protected] | 797c355 | 2011-03-17 00:26:18 | [diff] [blame] | 45 | #endif // CONTENT_COMMON_FONT_CONFIG_IPC_LINUX_H_ |