aw: Rendering test harness and end-to-end smoke test
[chromium-blink-merge.git] / content / common / font_config_ipc_linux.h
blobc5cf80f72744dac30632e84bd43563e9fa94472d
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
3 // found in the LICENSE file.
5 #ifndef CONTENT_COMMON_FONT_CONFIG_IPC_LINUX_H_
6 #define CONTENT_COMMON_FONT_CONFIG_IPC_LINUX_H_
8 #include "base/compiler_specific.h"
9 #include "third_party/skia/include/ports/SkFontConfigInterface.h"
11 #include <string>
13 namespace content {
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
17 class FontConfigIPC : public SkFontConfigInterface {
18 public:
19 explicit FontConfigIPC(int fd);
20 ~FontConfigIPC() override;
22 bool matchFamilyName(const char familyName[],
23 SkTypeface::Style requested,
24 FontIdentity* outFontIdentifier,
25 SkString* outFamilyName,
26 SkTypeface::Style* outStyle) override;
28 SkStream* openStream(const FontIdentity&) override;
30 enum Method {
31 METHOD_MATCH = 0,
32 METHOD_OPEN = 1,
35 enum {
36 kMaxFontFamilyLength = 2048
39 private:
40 const int fd_;
43 } // namespace content
45 #endif // CONTENT_COMMON_FONT_CONFIG_IPC_LINUX_H_