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/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> |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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) || |
67 !reply.ReadString(&iter, &reply_family) || | 67 !reply.ReadString(&iter, &reply_family) || |
68 !reply.ReadBool(&iter, &resulting_bold) || | 68 !reply.ReadBool(&iter, &resulting_bold) || |
69 !reply.ReadBool(&iter, &resulting_italic)) { | 69 !reply.ReadBool(&iter, &resulting_italic)) { |
70 return false; | 70 return false; |
71 } | 71 } |
72 | 72 |
73 *result_filefaceid = reply_filefaceid; | 73 if (result_filefaceid) |
| 74 *result_filefaceid = reply_filefaceid; |
74 if (result_family) | 75 if (result_family) |
75 *result_family = reply_family; | 76 *result_family = reply_family; |
76 | 77 |
77 if (is_bold) | 78 if (is_bold) |
78 *is_bold = resulting_bold; | 79 *is_bold = resulting_bold; |
79 if (is_italic) | 80 if (is_italic) |
80 *is_italic = resulting_italic; | 81 *is_italic = resulting_italic; |
81 | 82 |
82 return true; | 83 return true; |
83 } | 84 } |
(...skipping 17 matching lines...) Expand all Loading... |
101 PickleIterator iter(reply); | 102 PickleIterator iter(reply); |
102 if (!reply.ReadBool(&iter, &result) || | 103 if (!reply.ReadBool(&iter, &result) || |
103 !result) { | 104 !result) { |
104 if (result_fd) | 105 if (result_fd) |
105 close(result_fd); | 106 close(result_fd); |
106 return -1; | 107 return -1; |
107 } | 108 } |
108 | 109 |
109 return result_fd; | 110 return result_fd; |
110 } | 111 } |
OLD | NEW |