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_PUBLIC_COMMON_CHILD_PROCESS_SANDBOX_SUPPORT_LINUX_H_ | 5 #ifndef CONTENT_PUBLIC_COMMON_CHILD_PROCESS_SANDBOX_SUPPORT_LINUX_H_ |
6 #define CONTENT_PUBLIC_COMMON_CHILD_PROCESS_SANDBOX_SUPPORT_LINUX_H_ | 6 #define CONTENT_PUBLIC_COMMON_CHILD_PROCESS_SANDBOX_SUPPORT_LINUX_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 #include <string> | 9 #include <string> |
10 | 10 |
| 11 #include "base/process/process_handle.h" |
11 #include "content/common/content_export.h" | 12 #include "content/common/content_export.h" |
12 #include "ppapi/c/trusted/ppb_browser_font_trusted.h" | 13 #include "ppapi/c/trusted/ppb_browser_font_trusted.h" |
13 | 14 |
14 namespace content { | 15 namespace content { |
15 | 16 |
16 // Returns a file descriptor for a shared memory segment. The | 17 // Returns a file descriptor for a shared memory segment. The |
17 // executable flag indicates that the caller intends to use mprotect | 18 // 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 // 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 // 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 // ChromeOS, disallow PROT_EXEC in mmap on /dev/shm files but do allow |
(...skipping 22 matching lines...) Expand all Loading... |
43 // offset: offset into the table or entire font where loading should start. | 44 // offset: offset into the table or entire font where loading should start. |
44 // The offset must be between 0 and 1 GB - 1. | 45 // 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 // 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 // which case output_length will be set to the required size in bytes. |
47 // output_length: size of output, if it's not 0. | 48 // output_length: size of output, if it's not 0. |
48 // | 49 // |
49 // returns: true on success. | 50 // returns: true on success. |
50 CONTENT_EXPORT bool GetFontTable(int fd, uint32_t table_tag, off_t offset, | 51 CONTENT_EXPORT bool GetFontTable(int fd, uint32_t table_tag, off_t offset, |
51 uint8_t* output, size_t* output_length); | 52 uint8_t* output, size_t* output_length); |
52 | 53 |
| 54 // Asks the browser process to write the calling process's PID (as seen from |
| 55 // the browser process's namespace) to fd, which should be the writing end of |
| 56 // a pipe shared with the zygote process. |
| 57 // Additionally, if pid is not NULL, then the PID value is stored there; |
| 58 // otherwise, the PID value is guaranteed to never be passed to the caller's |
| 59 // address space. |
| 60 // Returns true on success. |
| 61 CONTENT_EXPORT bool SendRealPidToZygote(int fd, base::ProcessId* pid); |
| 62 |
53 }; // namespace content | 63 }; // namespace content |
54 | 64 |
55 #endif // CONTENT_PUBLIC_COMMON_CHILD_PROCESS_SANDBOX_SUPPORT_LINUX_H_ | 65 #endif // CONTENT_PUBLIC_COMMON_CHILD_PROCESS_SANDBOX_SUPPORT_LINUX_H_ |
OLD | NEW |