blob: 0325dc482805c155cb8de5f05de85aeda5c1f367 [file] [log] [blame]
[email protected]f7867172012-07-11 07:04:071// Copyright (c) 2012 The Chromium Authors. All rights reserved.
[email protected]cf3ac3972010-12-22 20:02:292// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
[email protected]797c3552011-03-17 00:26:185#ifndef CONTENT_COMMON_FONT_CONFIG_IPC_LINUX_H_
6#define CONTENT_COMMON_FONT_CONFIG_IPC_LINUX_H_
[email protected]cf3ac3972010-12-22 20:02:297
[email protected]5d536b82011-11-28 20:00:018#include "base/compiler_specific.h"
[email protected]9628e0d2013-03-12 13:11:549#include "third_party/skia/include/ports/SkFontConfigInterface.h"
[email protected]cf3ac3972010-12-22 20:02:2910
11#include <string>
12
[email protected]130757672012-10-24 00:26:1913namespace content {
14
[email protected]cf3ac3972010-12-22 20:02:2915// 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]9628e0d2013-03-12 13:11:5417class FontConfigIPC : public SkFontConfigInterface {
[email protected]cf3ac3972010-12-22 20:02:2918 public:
19 explicit FontConfigIPC(int fd);
[email protected]3690ebe02011-05-25 09:08:1920 virtual ~FontConfigIPC();
[email protected]cf3ac3972010-12-22 20:02:2921
[email protected]9628e0d2013-03-12 13:11:5422 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]cf3ac3972010-12-22 20:02:2929
30 enum Method {
31 METHOD_MATCH = 0,
32 METHOD_OPEN = 1,
33 };
34
[email protected]9628e0d2013-03-12 13:11:5435 enum {
36 kMaxFontFamilyLength = 2048
37 };
38
[email protected]cf3ac3972010-12-22 20:02:2939 private:
40 const int fd_;
41};
42
[email protected]130757672012-10-24 00:26:1943} // namespace content
44
[email protected]797c3552011-03-17 00:26:1845#endif // CONTENT_COMMON_FONT_CONFIG_IPC_LINUX_H_