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_PULIC_COMMON_CHILD_PROCESS_SANDBOX_SUPPORT_LINUX_H_
6 #define CONTENT_PULIC_COMMON_CHILD_PROCESS_SANDBOX_SUPPORT_LINUX_H_
11 #include "content/common/content_export.h"
15 // Returns a file descriptor for a shared memory segment. The
16 // executable flag indicates that the caller intends to use mprotect
17 // with PROT_EXEC after making a mapping, but not that it intends to
18 // mmap with PROT_EXEC in the first place. (Some systems, such as
19 // ChromeOS, disallow PROT_EXEC in mmap on /dev/shm files but do allow
20 // PROT_EXEC in mprotect on mappings from such files. This function
21 // can yield an object that has that constraint.)
22 CONTENT_EXPORT
int MakeSharedMemorySegmentViaIPC(size_t length
,
25 // Return a read-only file descriptor to the font which best matches the given
26 // properties or -1 on failure.
27 // charset: specifies the language(s) that the font must cover. See
28 // render_sandbox_host_linux.cc for more information.
29 CONTENT_EXPORT
int MatchFontWithFallback(const std::string
& face
, bool bold
,
30 bool italic
, int charset
);
32 // GetFontTable loads a specified font table from an open SFNT file.
33 // fd: a file descriptor to the SFNT file. The position doesn't matter.
34 // table: the table in *big-endian* format, or 0 for the whole font file.
35 // output: a buffer of size output_length that gets the data. can be 0, in
36 // which case output_length will be set to the required size in bytes.
37 // output_length: size of output, if it's not 0.
39 // returns: true on success.
40 CONTENT_EXPORT
bool GetFontTable(int fd
, uint32_t table
, uint8_t* output
,
41 size_t* output_length
);
43 }; // namespace content
45 #endif // CONTENT_PULIC_COMMON_CHILD_PROCESS_SANDBOX_SUPPORT_LINUX_H_