OLD | NEW |
1 // Copyright (c) 2010 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/font_config_ipc_linux.h" | 5 #include "content/common/font_config_ipc_linux.h" |
6 | 6 |
7 #include <errno.h> | 7 #include <errno.h> |
8 #include <unistd.h> | 8 #include <unistd.h> |
9 #include <fcntl.h> | 9 #include <fcntl.h> |
10 #include <sys/socket.h> | 10 #include <sys/socket.h> |
11 #include <sys/uio.h> | 11 #include <sys/uio.h> |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
46 request.WriteString(family); | 46 request.WriteString(family); |
47 | 47 |
48 uint8_t reply_buf[512]; | 48 uint8_t reply_buf[512]; |
49 const ssize_t r = UnixDomainSocket::SendRecvMsg(fd_, reply_buf, | 49 const ssize_t r = UnixDomainSocket::SendRecvMsg(fd_, reply_buf, |
50 sizeof(reply_buf), NULL, | 50 sizeof(reply_buf), NULL, |
51 request); | 51 request); |
52 if (r == -1) | 52 if (r == -1) |
53 return false; | 53 return false; |
54 | 54 |
55 Pickle reply(reinterpret_cast<char*>(reply_buf), r); | 55 Pickle reply(reinterpret_cast<char*>(reply_buf), r); |
56 void* iter = NULL; | 56 PickleIterator iter(reply); |
57 bool result; | 57 bool result; |
58 if (!reply.ReadBool(&iter, &result)) | 58 if (!reply.ReadBool(&iter, &result)) |
59 return false; | 59 return false; |
60 if (!result) | 60 if (!result) |
61 return false; | 61 return false; |
62 | 62 |
63 uint32_t reply_filefaceid; | 63 uint32_t reply_filefaceid; |
64 std::string reply_family; | 64 std::string reply_family; |
65 bool resulting_bold, resulting_italic; | 65 bool resulting_bold, resulting_italic; |
66 if (!reply.ReadUInt32(&iter, &reply_filefaceid) || | 66 if (!reply.ReadUInt32(&iter, &reply_filefaceid) || |
(...skipping 24 matching lines...) Expand all Loading... |
91 uint8_t reply_buf[256]; | 91 uint8_t reply_buf[256]; |
92 const ssize_t r = UnixDomainSocket::SendRecvMsg(fd_, reply_buf, | 92 const ssize_t r = UnixDomainSocket::SendRecvMsg(fd_, reply_buf, |
93 sizeof(reply_buf), | 93 sizeof(reply_buf), |
94 &result_fd, request); | 94 &result_fd, request); |
95 | 95 |
96 if (r == -1) | 96 if (r == -1) |
97 return -1; | 97 return -1; |
98 | 98 |
99 Pickle reply(reinterpret_cast<char*>(reply_buf), r); | 99 Pickle reply(reinterpret_cast<char*>(reply_buf), r); |
100 bool result; | 100 bool result; |
101 void* iter = NULL; | 101 PickleIterator iter(reply); |
102 if (!reply.ReadBool(&iter, &result) || | 102 if (!reply.ReadBool(&iter, &result) || |
103 !result) { | 103 !result) { |
104 if (result_fd) | 104 if (result_fd) |
105 close(result_fd); | 105 close(result_fd); |
106 return -1; | 106 return -1; |
107 } | 107 } |
108 | 108 |
109 return result_fd; | 109 return result_fd; |
110 } | 110 } |
OLD | NEW |