Chromium Code Reviews| 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/browser/renderer_host/render_sandbox_host_linux.h" | 5 #include "content/browser/renderer_host/render_sandbox_host_linux.h" |
| 6 | 6 |
| 7 #include <fcntl.h> | 7 #include <fcntl.h> |
| 8 #include <fontconfig/fontconfig.h> | 8 #include <fontconfig/fontconfig.h> |
| 9 #include <stdint.h> | 9 #include <stdint.h> |
| 10 #include <sys/poll.h> | 10 #include <sys/poll.h> |
| (...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 217 const int result_fd = open(paths_[index]->c_str(), O_RDONLY); | 217 const int result_fd = open(paths_[index]->c_str(), O_RDONLY); |
| 218 | 218 |
| 219 Pickle reply; | 219 Pickle reply; |
| 220 if (result_fd == -1) { | 220 if (result_fd == -1) { |
| 221 reply.WriteBool(false); | 221 reply.WriteBool(false); |
| 222 } else { | 222 } else { |
| 223 reply.WriteBool(true); | 223 reply.WriteBool(true); |
| 224 } | 224 } |
| 225 | 225 |
| 226 SendRendererReply(fds, reply, result_fd); | 226 SendRendererReply(fds, reply, result_fd); |
| 227 | |
| 228 if (result_fd >= 0) { | |
| 229 close(result_fd); | |
|
jln (very slow on Chromium)
2013/03/18 16:07:21
Please, add HANDLE_EINTR + DCHECK
reed1
2013/03/18 16:56:07
Done.
| |
| 230 } | |
| 227 } | 231 } |
| 228 | 232 |
| 229 void HandleGetFontFamilyForChars(int fd, const Pickle& pickle, | 233 void HandleGetFontFamilyForChars(int fd, const Pickle& pickle, |
| 230 PickleIterator iter, | 234 PickleIterator iter, |
| 231 std::vector<int>& fds) { | 235 std::vector<int>& fds) { |
| 232 // The other side of this call is | 236 // The other side of this call is |
| 233 // chrome/renderer/renderer_sandbox_support_linux.cc | 237 // chrome/renderer/renderer_sandbox_support_linux.cc |
| 234 | 238 |
| 235 int num_chars; | 239 int num_chars; |
| 236 if (!pickle.ReadInt(&iter, &num_chars)) | 240 if (!pickle.ReadInt(&iter, &num_chars)) |
| (...skipping 490 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 727 RenderSandboxHostLinux::~RenderSandboxHostLinux() { | 731 RenderSandboxHostLinux::~RenderSandboxHostLinux() { |
| 728 if (initialized_) { | 732 if (initialized_) { |
| 729 if (HANDLE_EINTR(close(renderer_socket_)) < 0) | 733 if (HANDLE_EINTR(close(renderer_socket_)) < 0) |
| 730 PLOG(ERROR) << "close"; | 734 PLOG(ERROR) << "close"; |
| 731 if (HANDLE_EINTR(close(childs_lifeline_fd_)) < 0) | 735 if (HANDLE_EINTR(close(childs_lifeline_fd_)) < 0) |
| 732 PLOG(ERROR) << "close"; | 736 PLOG(ERROR) << "close"; |
| 733 } | 737 } |
| 734 } | 738 } |
| 735 | 739 |
| 736 } // namespace content | 740 } // namespace content |
| OLD | NEW |