Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(71)

Side by Side Diff: content/public/common/child_process_sandbox_support_linux.h

Issue 8585002: Give base::SharedMemory::CreateAnonymous an executable flag (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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_PULIC_COMMON_CHILD_PROCESS_SANDBOX_SUPPORT_LINUX_H_ 5 #ifndef CONTENT_PULIC_COMMON_CHILD_PROCESS_SANDBOX_SUPPORT_LINUX_H_
6 #define CONTENT_PULIC_COMMON_CHILD_PROCESS_SANDBOX_SUPPORT_LINUX_H_ 6 #define CONTENT_PULIC_COMMON_CHILD_PROCESS_SANDBOX_SUPPORT_LINUX_H_
7 #pragma once 7 #pragma once
8 8
9 #include <stdint.h> 9 #include <stdint.h>
10 #include <string> 10 #include <string>
11 11
12 #include "content/common/content_export.h" 12 #include "content/common/content_export.h"
13 13
14 namespace content { 14 namespace content {
15 15
16 // Returns a file descriptor for a shared memory segment. 16 // Returns a file descriptor for a shared memory segment.
17 // The second argument is ignored because SHM segments are always 17 // The executable flag indicates that we'll need to use mprotect
18 // mappable with PROT_EXEC on Linux. 18 // with PROT_EXEC after making a mapping, but not that we'll need
19 // to mmap with PROT_EXEC in the first place.
19 CONTENT_EXPORT int MakeSharedMemorySegmentViaIPC(size_t length, 20 CONTENT_EXPORT int MakeSharedMemorySegmentViaIPC(size_t length,
20 bool executable); 21 bool executable);
21 22
22 // Return a read-only file descriptor to the font which best matches the given 23 // Return a read-only file descriptor to the font which best matches the given
23 // properties or -1 on failure. 24 // properties or -1 on failure.
24 // charset: specifies the language(s) that the font must cover. See 25 // charset: specifies the language(s) that the font must cover. See
25 // render_sandbox_host_linux.cc for more information. 26 // render_sandbox_host_linux.cc for more information.
26 CONTENT_EXPORT int MatchFontWithFallback(const std::string& face, bool bold, 27 CONTENT_EXPORT int MatchFontWithFallback(const std::string& face, bool bold,
27 bool italic, int charset); 28 bool italic, int charset);
28 29
29 // GetFontTable loads a specified font table from an open SFNT file. 30 // GetFontTable loads a specified font table from an open SFNT file.
30 // fd: a file descriptor to the SFNT file. The position doesn't matter. 31 // fd: a file descriptor to the SFNT file. The position doesn't matter.
31 // table: the table in *big-endian* format, or 0 for the whole font file. 32 // table: the table in *big-endian* format, or 0 for the whole font file.
32 // output: a buffer of size output_length that gets the data. can be 0, in 33 // output: a buffer of size output_length that gets the data. can be 0, in
33 // which case output_length will be set to the required size in bytes. 34 // which case output_length will be set to the required size in bytes.
34 // output_length: size of output, if it's not 0. 35 // output_length: size of output, if it's not 0.
35 // 36 //
36 // returns: true on success. 37 // returns: true on success.
37 CONTENT_EXPORT bool GetFontTable(int fd, uint32_t table, uint8_t* output, 38 CONTENT_EXPORT bool GetFontTable(int fd, uint32_t table, uint8_t* output,
38 size_t* output_length); 39 size_t* output_length);
39 40
40 }; // namespace content 41 }; // namespace content
41 42
42 #endif // CONTENT_PULIC_COMMON_CHILD_PROCESS_SANDBOX_SUPPORT_LINUX_H_ 43 #endif // CONTENT_PULIC_COMMON_CHILD_PROCESS_SANDBOX_SUPPORT_LINUX_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698