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 #include "content/common/child_process_sandbox_support_impl_linux.h" | 5 #include "content/common/child_process_sandbox_support_impl_linux.h" |
6 | 6 |
7 #include <sys/stat.h> | 7 #include <sys/stat.h> |
8 | 8 |
9 #include "base/debug/trace_event.h" | 9 #include "base/debug/trace_event.h" |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
(...skipping 18 matching lines...) Expand all Loading... |
29 request.WriteInt(LinuxSandbox::METHOD_GET_FALLBACK_FONT_FOR_CHAR); | 29 request.WriteInt(LinuxSandbox::METHOD_GET_FALLBACK_FONT_FOR_CHAR); |
30 request.WriteInt(character); | 30 request.WriteInt(character); |
31 request.WriteString(preferred_locale); | 31 request.WriteString(preferred_locale); |
32 | 32 |
33 uint8_t buf[512]; | 33 uint8_t buf[512]; |
34 const ssize_t n = UnixDomainSocket::SendRecvMsg(GetSandboxFD(), buf, | 34 const ssize_t n = UnixDomainSocket::SendRecvMsg(GetSandboxFD(), buf, |
35 sizeof(buf), NULL, request); | 35 sizeof(buf), NULL, request); |
36 | 36 |
37 std::string family_name; | 37 std::string family_name; |
38 std::string filename; | 38 std::string filename; |
| 39 int fontconfigInterfaceId = 0; |
39 int ttcIndex = 0; | 40 int ttcIndex = 0; |
40 bool isBold = false; | 41 bool isBold = false; |
41 bool isItalic = false; | 42 bool isItalic = false; |
42 if (n != -1) { | 43 if (n != -1) { |
43 Pickle reply(reinterpret_cast<char*>(buf), n); | 44 Pickle reply(reinterpret_cast<char*>(buf), n); |
44 PickleIterator pickle_iter(reply); | 45 PickleIterator pickle_iter(reply); |
45 if (reply.ReadString(&pickle_iter, &family_name) && | 46 if (reply.ReadString(&pickle_iter, &family_name) && |
46 reply.ReadString(&pickle_iter, &filename) && | 47 reply.ReadString(&pickle_iter, &filename) && |
| 48 reply.ReadInt(&pickle_iter, &fontconfigInterfaceId) && |
47 reply.ReadInt(&pickle_iter, &ttcIndex) && | 49 reply.ReadInt(&pickle_iter, &ttcIndex) && |
48 reply.ReadBool(&pickle_iter, &isBold) && | 50 reply.ReadBool(&pickle_iter, &isBold) && |
49 reply.ReadBool(&pickle_iter, &isItalic)) { | 51 reply.ReadBool(&pickle_iter, &isItalic)) { |
50 fallbackFont->name = family_name; | 52 fallbackFont->name = family_name; |
51 fallbackFont->filename = filename; | 53 fallbackFont->filename = filename; |
| 54 fallbackFont->fontconfigInterfaceId = fontconfigInterfaceId; |
52 fallbackFont->ttcIndex = ttcIndex; | 55 fallbackFont->ttcIndex = ttcIndex; |
53 fallbackFont->isBold = isBold; | 56 fallbackFont->isBold = isBold; |
54 fallbackFont->isItalic = isItalic; | 57 fallbackFont->isItalic = isItalic; |
55 } | 58 } |
56 } | 59 } |
57 } | 60 } |
58 | 61 |
59 void GetRenderStyleForStrike(const char* family, int sizeAndStyle, | 62 void GetRenderStyleForStrike(const char* family, int sizeAndStyle, |
60 blink::WebFontRenderStyle* out) { | 63 blink::WebFontRenderStyle* out) { |
61 TRACE_EVENT0("sandbox_ipc", "GetRenderStyleForStrike"); | 64 TRACE_EVENT0("sandbox_ipc", "GetRenderStyleForStrike"); |
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
189 } | 192 } |
190 | 193 |
191 bool SendZygoteChildPing(int fd) { | 194 bool SendZygoteChildPing(int fd) { |
192 return UnixDomainSocket::SendMsg(fd, | 195 return UnixDomainSocket::SendMsg(fd, |
193 kZygoteChildPingMessage, | 196 kZygoteChildPingMessage, |
194 sizeof(kZygoteChildPingMessage), | 197 sizeof(kZygoteChildPingMessage), |
195 std::vector<int>()); | 198 std::vector<int>()); |
196 } | 199 } |
197 | 200 |
198 } // namespace content | 201 } // namespace content |
OLD | NEW |