OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 CHROME_RENDERER_RENDERER_SANDBOX_SUPPORT_LINUX_H_ | 5 #ifndef CHROME_RENDERER_RENDERER_SANDBOX_SUPPORT_LINUX_H_ |
6 #define CHROME_RENDERER_RENDERER_SANDBOX_SUPPORT_LINUX_H_ | 6 #define CHROME_RENDERER_RENDERER_SANDBOX_SUPPORT_LINUX_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <stdint.h> | 9 #include <stdint.h> |
10 | 10 |
11 #include <string> | 11 #include <string> |
12 | 12 |
13 namespace WebKit { | 13 namespace WebKit { |
14 struct WebFontRenderStyle; | 14 struct WebFontRenderStyle; |
15 } | 15 } |
16 | 16 |
17 namespace renderer_sandbox_support { | 17 namespace renderer_sandbox_support { |
18 | 18 |
19 // Return a font family which provides glyphs for the Unicode code points | 19 // Return a font family which provides glyphs for the Unicode code points |
20 // specified by |utf16| | 20 // specified by |utf16| |
21 // utf16: a native-endian UTF16 string | 21 // utf16: a native-endian UTF16 string |
22 // num_utf16: the number of 16-bit words in |utf16| | 22 // num_utf16: the number of 16-bit words in |utf16| |
| 23 // preferred_locale: preferred locale identifier for the |utf16| |
23 // | 24 // |
24 // Returns: the font family or an empty string if the request could not be | 25 // Returns: the font family or an empty string if the request could not be |
25 // satisfied. | 26 // satisfied. |
26 std::string getFontFamilyForCharacters(const uint16_t* utf16, size_t num_utf16); | 27 std::string getFontFamilyForCharacters(const uint16_t* utf16, |
| 28 size_t num_utf16, |
| 29 const char* preferred_locale); |
27 | 30 |
28 void getRenderStyleForStrike(const char* family, int sizeAndStyle, | 31 void getRenderStyleForStrike(const char* family, int sizeAndStyle, |
29 WebKit::WebFontRenderStyle* out); | 32 WebKit::WebFontRenderStyle* out); |
30 | 33 |
31 // Returns a file descriptor for a shared memory segment. | 34 // Returns a file descriptor for a shared memory segment. |
32 // The second argument is ignored because SHM segments are always | 35 // The second argument is ignored because SHM segments are always |
33 // mappable with PROT_EXEC on Linux. | 36 // mappable with PROT_EXEC on Linux. |
34 int MakeSharedMemorySegmentViaIPC(size_t length, bool executable); | 37 int MakeSharedMemorySegmentViaIPC(size_t length, bool executable); |
35 | 38 |
36 // Return a read-only file descriptor to the font which best matches the given | 39 // Return a read-only file descriptor to the font which best matches the given |
(...skipping 10 matching lines...) Expand all Loading... |
47 // which case output_length will be set to the required size in bytes. | 50 // which case output_length will be set to the required size in bytes. |
48 // output_length: size of output, if it's not 0. | 51 // output_length: size of output, if it's not 0. |
49 // | 52 // |
50 // returns: true on success. | 53 // returns: true on success. |
51 bool GetFontTable(int fd, uint32_t table, uint8_t* output, | 54 bool GetFontTable(int fd, uint32_t table, uint8_t* output, |
52 size_t* output_length); | 55 size_t* output_length); |
53 | 56 |
54 }; // namespace render_sandbox_support | 57 }; // namespace render_sandbox_support |
55 | 58 |
56 #endif // CHROME_RENDERER_RENDERER_SANDBOX_SUPPORT_LINUX_H_ | 59 #endif // CHROME_RENDERER_RENDERER_SANDBOX_SUPPORT_LINUX_H_ |
OLD | NEW |