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/eintr_wrapper.h" | 9 #include "base/eintr_wrapper.h" |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
58 const ssize_t n = UnixDomainSocket::SendRecvMsg(GetSandboxFD(), buf, | 58 const ssize_t n = UnixDomainSocket::SendRecvMsg(GetSandboxFD(), buf, |
59 sizeof(buf), NULL, request); | 59 sizeof(buf), NULL, request); |
60 | 60 |
61 out->setDefaults(); | 61 out->setDefaults(); |
62 if (n == -1) { | 62 if (n == -1) { |
63 return; | 63 return; |
64 } | 64 } |
65 | 65 |
66 Pickle reply(reinterpret_cast<char*>(buf), n); | 66 Pickle reply(reinterpret_cast<char*>(buf), n); |
67 PickleIterator pickle_iter(reply); | 67 PickleIterator pickle_iter(reply); |
68 int useBitmaps, useAutoHint, useHinting, hintStyle, useAntiAlias, useSubpixel; | 68 int useBitmaps, useAutoHint, useHinting, hintStyle, useAntiAlias; |
| 69 int useSubpixelRendering, useSubpixelPositioning; |
69 if (reply.ReadInt(&pickle_iter, &useBitmaps) && | 70 if (reply.ReadInt(&pickle_iter, &useBitmaps) && |
70 reply.ReadInt(&pickle_iter, &useAutoHint) && | 71 reply.ReadInt(&pickle_iter, &useAutoHint) && |
71 reply.ReadInt(&pickle_iter, &useHinting) && | 72 reply.ReadInt(&pickle_iter, &useHinting) && |
72 reply.ReadInt(&pickle_iter, &hintStyle) && | 73 reply.ReadInt(&pickle_iter, &hintStyle) && |
73 reply.ReadInt(&pickle_iter, &useAntiAlias) && | 74 reply.ReadInt(&pickle_iter, &useAntiAlias) && |
74 reply.ReadInt(&pickle_iter, &useSubpixel)) { | 75 reply.ReadInt(&pickle_iter, &useSubpixelRendering) && |
| 76 reply.ReadInt(&pickle_iter, &useSubpixelPositioning)) { |
75 out->useBitmaps = useBitmaps; | 77 out->useBitmaps = useBitmaps; |
76 out->useAutoHint = useAutoHint; | 78 out->useAutoHint = useAutoHint; |
77 out->useHinting = useHinting; | 79 out->useHinting = useHinting; |
78 out->hintStyle = hintStyle; | 80 out->hintStyle = hintStyle; |
79 out->useAntiAlias = useAntiAlias; | 81 out->useAntiAlias = useAntiAlias; |
80 out->useSubpixel = useSubpixel; | 82 out->useSubpixelRendering = useSubpixelRendering; |
| 83 out->useSubpixelPositioning = useSubpixelPositioning; |
81 } | 84 } |
82 } | 85 } |
83 | 86 |
84 int MatchFontWithFallback(const std::string& face, bool bold, | 87 int MatchFontWithFallback(const std::string& face, bool bold, |
85 bool italic, int charset) { | 88 bool italic, int charset) { |
86 Pickle request; | 89 Pickle request; |
87 request.WriteInt(LinuxSandbox::METHOD_MATCH_WITH_FALLBACK); | 90 request.WriteInt(LinuxSandbox::METHOD_MATCH_WITH_FALLBACK); |
88 request.WriteString(face); | 91 request.WriteString(face); |
89 request.WriteBool(bold); | 92 request.WriteBool(bold); |
90 request.WriteBool(italic); | 93 request.WriteBool(italic); |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
167 | 170 |
168 *output_length = length; | 171 *output_length = length; |
169 n = HANDLE_EINTR(pread(fd, output, length, offset)); | 172 n = HANDLE_EINTR(pread(fd, output, length, offset)); |
170 if (n != static_cast<ssize_t>(length)) | 173 if (n != static_cast<ssize_t>(length)) |
171 return false; | 174 return false; |
172 | 175 |
173 return true; | 176 return true; |
174 } | 177 } |
175 | 178 |
176 } // namespace content | 179 } // namespace content |
OLD | NEW |