| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. Use of this | 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. Use of this |
| 2 // source code is governed by a BSD-style license that can be found in the | 2 // source code is governed by a BSD-style license that can be found in the |
| 3 // LICENSE file. | 3 // LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/renderer/renderer_sandbox_support_linux.h" | 5 #include "chrome/renderer/renderer_sandbox_support_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/global_descriptors_posix.h" | 10 #include "base/global_descriptors_posix.h" |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 86 int result_fd; | 86 int result_fd; |
| 87 ssize_t result = base::SendRecvMsg(GetSandboxFD(), | 87 ssize_t result = base::SendRecvMsg(GetSandboxFD(), |
| 88 reply_buf, sizeof(reply_buf), | 88 reply_buf, sizeof(reply_buf), |
| 89 &result_fd, request); | 89 &result_fd, request); |
| 90 if (result == -1) | 90 if (result == -1) |
| 91 return -1; | 91 return -1; |
| 92 return result_fd; | 92 return result_fd; |
| 93 } | 93 } |
| 94 | 94 |
| 95 int MatchFontWithFallback(const std::string& face, bool bold, | 95 int MatchFontWithFallback(const std::string& face, bool bold, |
| 96 bool italic, NPCharset charset) { | 96 bool italic, int charset) { |
| 97 Pickle request; | 97 Pickle request; |
| 98 request.WriteInt(LinuxSandbox::METHOD_MATCH_WITH_FALLBACK); | 98 request.WriteInt(LinuxSandbox::METHOD_MATCH_WITH_FALLBACK); |
| 99 request.WriteString(face); | 99 request.WriteString(face); |
| 100 request.WriteBool(bold); | 100 request.WriteBool(bold); |
| 101 request.WriteBool(italic); | 101 request.WriteBool(italic); |
| 102 request.WriteUInt32(charset); | 102 request.WriteUInt32(charset); |
| 103 uint8_t reply_buf[64]; | 103 uint8_t reply_buf[64]; |
| 104 int fd = -1; | 104 int fd = -1; |
| 105 base::SendRecvMsg(GetSandboxFD(), reply_buf, sizeof(reply_buf), | 105 base::SendRecvMsg(GetSandboxFD(), reply_buf, sizeof(reply_buf), |
| 106 &fd, request); | 106 &fd, request); |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 178 | 178 |
| 179 *output_length = length; | 179 *output_length = length; |
| 180 n = HANDLE_EINTR(pread(fd, output, length, offset)); | 180 n = HANDLE_EINTR(pread(fd, output, length, offset)); |
| 181 if (n != static_cast<ssize_t>(length)) | 181 if (n != static_cast<ssize_t>(length)) |
| 182 return false; | 182 return false; |
| 183 | 183 |
| 184 return true; | 184 return true; |
| 185 } | 185 } |
| 186 | 186 |
| 187 } // namespace render_sandbox_support | 187 } // namespace render_sandbox_support |
| OLD | NEW |