| 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> |
| 11 #include <sys/uio.h> | 11 #include <sys/uio.h> |
| 12 | 12 |
| 13 #include "base/pickle.h" | 13 #include "base/pickle.h" |
| 14 #include "base/posix/unix_domain_socket.h" | 14 #include "base/posix/unix_domain_socket.h" |
| 15 | 15 |
| 16 namespace content { |
| 17 |
| 16 FontConfigIPC::FontConfigIPC(int fd) | 18 FontConfigIPC::FontConfigIPC(int fd) |
| 17 : fd_(fd) { | 19 : fd_(fd) { |
| 18 } | 20 } |
| 19 | 21 |
| 20 FontConfigIPC::~FontConfigIPC() { | 22 FontConfigIPC::~FontConfigIPC() { |
| 21 close(fd_); | 23 close(fd_); |
| 22 } | 24 } |
| 23 | 25 |
| 24 bool FontConfigIPC::Match(std::string* result_family, | 26 bool FontConfigIPC::Match(std::string* result_family, |
| 25 unsigned* result_filefaceid, | 27 unsigned* result_filefaceid, |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 102 PickleIterator iter(reply); | 104 PickleIterator iter(reply); |
| 103 if (!reply.ReadBool(&iter, &result) || | 105 if (!reply.ReadBool(&iter, &result) || |
| 104 !result) { | 106 !result) { |
| 105 if (result_fd) | 107 if (result_fd) |
| 106 close(result_fd); | 108 close(result_fd); |
| 107 return -1; | 109 return -1; |
| 108 } | 110 } |
| 109 | 111 |
| 110 return result_fd; | 112 return result_fd; |
| 111 } | 113 } |
| 114 |
| 115 } // namespace content |
| OLD | NEW |