| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CONTENT_COMMON_FONT_CONFIG_IPC_LINUX_H_ | 5 #ifndef CONTENT_COMMON_FONT_CONFIG_IPC_LINUX_H_ |
| 6 #define CONTENT_COMMON_FONT_CONFIG_IPC_LINUX_H_ | 6 #define CONTENT_COMMON_FONT_CONFIG_IPC_LINUX_H_ |
| 7 | 7 |
| 8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
| 9 #include "third_party/skia/include/core/SkStream.h" |
| 10 #include "third_party/skia/include/core/SkTypeface.h" |
| 9 #include "third_party/skia/include/ports/SkFontConfigInterface.h" | 11 #include "third_party/skia/include/ports/SkFontConfigInterface.h" |
| 10 | 12 |
| 11 #include <string> | 13 #include <string> |
| 12 | 14 |
| 15 class SkString; |
| 16 |
| 13 namespace content { | 17 namespace content { |
| 14 | 18 |
| 15 // FontConfig implementation for Skia that proxies out of process to get out | 19 // 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 | 20 // of the sandbox. See http://code.google.com/p/chromium/wiki/LinuxSandboxIPC |
| 17 class FontConfigIPC : public SkFontConfigInterface { | 21 class FontConfigIPC : public SkFontConfigInterface { |
| 18 public: | 22 public: |
| 19 explicit FontConfigIPC(int fd); | 23 explicit FontConfigIPC(int fd); |
| 20 ~FontConfigIPC() override; | 24 ~FontConfigIPC() override; |
| 21 | 25 |
| 22 bool matchFamilyName(const char familyName[], | 26 bool matchFamilyName(const char familyName[], |
| 23 SkTypeface::Style requested, | 27 SkTypeface::Style requested, |
| 24 FontIdentity* outFontIdentifier, | 28 FontIdentity* outFontIdentifier, |
| 25 SkString* outFamilyName, | 29 SkString* outFamilyName, |
| 26 SkTypeface::Style* outStyle) override; | 30 SkTypeface::Style* outStyle) override; |
| 27 | 31 |
| 28 SkStream* openStream(const FontIdentity&) override; | 32 SkStreamAsset* openStream(const FontIdentity&) override; |
| 29 | 33 |
| 30 enum Method { | 34 enum Method { |
| 31 METHOD_MATCH = 0, | 35 METHOD_MATCH = 0, |
| 32 METHOD_OPEN = 1, | 36 METHOD_OPEN = 1, |
| 33 }; | 37 }; |
| 34 | 38 |
| 35 enum { | 39 enum { |
| 36 kMaxFontFamilyLength = 2048 | 40 kMaxFontFamilyLength = 2048 |
| 37 }; | 41 }; |
| 38 | 42 |
| 39 private: | 43 private: |
| 40 const int fd_; | 44 const int fd_; |
| 41 }; | 45 }; |
| 42 | 46 |
| 43 } // namespace content | 47 } // namespace content |
| 44 | 48 |
| 45 #endif // CONTENT_COMMON_FONT_CONFIG_IPC_LINUX_H_ | 49 #endif // CONTENT_COMMON_FONT_CONFIG_IPC_LINUX_H_ |
| OLD | NEW |