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.
4
5#ifndef CONTENT_COMMON_CHILD_PROCESS_SANDBOX_SUPPORT_IMPL_LINUX_H_
6#define CONTENT_COMMON_CHILD_PROCESS_SANDBOX_SUPPORT_IMPL_LINUX_H_
7
8#include "base/posix/global_descriptors.h"
9#include "content/public/common/child_process_sandbox_support_linux.h"
10#include "content/public/common/content_descriptors.h"
11
12namespace blink {
13struct WebFallbackFont;
14struct WebFontRenderStyle;
15}
16
17namespace content {
18
19// Returns a font family which provides glyphs for the Unicode code point
20// specified by |character|, a UTF-32 character. |preferred_locale| contains the
21// preferred locale identifier for |character|. The instance has an empty font
22// name if the request could not be satisfied.
23void GetFallbackFontForCharacter(const int32_t character,
24                                 const char* preferred_locale,
25                                 blink::WebFallbackFont* family);
26
27// Returns rendering settings for a provided font family, size, and style.
28// |size_and_style| stores the bold setting in its least-significant bit, the
29// italic setting in its second-least-significant bit, and holds the requested
30// size in pixels into its remaining bits.
31// TODO(derat): Update WebSandboxSupport's getRenderStyleForStrike() method to
32// pass the style and size separately instead of packing them into an int.
33void GetRenderStyleForStrike(const char* family,
34                             int size_and_style,
35                             blink::WebFontRenderStyle* out);
36
37inline int GetSandboxFD() {
38  return kSandboxIPCChannel + base::GlobalDescriptors::kBaseDescriptor;
39}
40
41};  // namespace content
42
43#endif  // CONTENT_COMMON_CHILD_PROCESS_SANDBOX_SUPPORT_IMPL_LINUX_H_
44