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_PUBLIC_COMMON_CHILD_PROCESS_SANDBOX_SUPPORT_LINUX_H_
6 #define CONTENT_PUBLIC_COMMON_CHILD_PROCESS_SANDBOX_SUPPORT_LINUX_H_
11 #include "content/common/content_export.h"
12 #include "ppapi/c/trusted/ppb_browser_font_trusted.h"
16 // Returns a file descriptor for a shared memory segment. The
17 // executable flag indicates that the caller intends to use mprotect
18 // with PROT_EXEC after making a mapping, but not that it intends to
19 // mmap with PROT_EXEC in the first place. (Some systems, such as
20 // ChromeOS, disallow PROT_EXEC in mmap on /dev/shm files but do allow
21 // PROT_EXEC in mprotect on mappings from such files. This function
22 // can yield an object that has that constraint.)
23 CONTENT_EXPORT
int MakeSharedMemorySegmentViaIPC(size_t length
,
26 // Return a read-only file descriptor to the font which best matches the given
27 // properties or -1 on failure.
28 // charset: specifies the language(s) that the font must cover. See
29 // render_sandbox_host_linux.cc for more information.
30 // fallback_family: If not set to PP_BROWSERFONT_TRUSTED_FAMILY_DEFAULT, font
31 // selection should fall back to generic Windows font names like Arial and
33 CONTENT_EXPORT
int MatchFontWithFallback(
34 const std::string
& face
,
38 PP_BrowserFont_Trusted_Family fallback_family
);
40 // GetFontTable loads a specified font table from an open SFNT file.
41 // fd: a file descriptor to the SFNT file. The position doesn't matter.
42 // table_tag: the table tag in *big-endian* format, or 0 for the entire font.
43 // offset: offset into the table or entire font where loading should start.
44 // The offset must be between 0 and 1 GB - 1.
45 // output: a buffer of size output_length that gets the data. can be 0, in
46 // which case output_length will be set to the required size in bytes.
47 // output_length: size of output, if it's not 0.
49 // returns: true on success.
50 CONTENT_EXPORT
bool GetFontTable(int fd
, uint32_t table_tag
, off_t offset
,
51 uint8_t* output
, size_t* output_length
);
53 // Sends a zygote child "ping" message to browser process via socket |fd|.
54 // Returns true on success.
55 CONTENT_EXPORT
bool SendZygoteChildPing(int fd
);
57 }; // namespace content
59 #endif // CONTENT_PUBLIC_COMMON_CHILD_PROCESS_SANDBOX_SUPPORT_LINUX_H_