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 205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 216 return; | 216 return; |
| 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 // The receiver will have its own access to the file, so we will close it | |
| 227 // after this send. | |
| 226 SendRendererReply(fds, reply, result_fd); | 228 SendRendererReply(fds, reply, result_fd); |
| 229 | |
| 230 if (result_fd >= 0) { | |
| 231 DCHECK(!HANDLE_EINTR(close(result_fd))); | |
|
jln (very slow on Chromium)
2013/03/19 10:23:27
We missed moving this out of DCHECK. And it's argu
| |
| 232 } | |
| 227 } | 233 } |
| 228 | 234 |
| 229 void HandleGetFontFamilyForChars(int fd, const Pickle& pickle, | 235 void HandleGetFontFamilyForChars(int fd, const Pickle& pickle, |
| 230 PickleIterator iter, | 236 PickleIterator iter, |
| 231 std::vector<int>& fds) { | 237 std::vector<int>& fds) { |
| 232 // The other side of this call is | 238 // The other side of this call is |
| 233 // chrome/renderer/renderer_sandbox_support_linux.cc | 239 // chrome/renderer/renderer_sandbox_support_linux.cc |
| 234 | 240 |
| 235 int num_chars; | 241 int num_chars; |
| 236 if (!pickle.ReadInt(&iter, &num_chars)) | 242 if (!pickle.ReadInt(&iter, &num_chars)) |
| (...skipping 490 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 727 RenderSandboxHostLinux::~RenderSandboxHostLinux() { | 733 RenderSandboxHostLinux::~RenderSandboxHostLinux() { |
| 728 if (initialized_) { | 734 if (initialized_) { |
| 729 if (HANDLE_EINTR(close(renderer_socket_)) < 0) | 735 if (HANDLE_EINTR(close(renderer_socket_)) < 0) |
| 730 PLOG(ERROR) << "close"; | 736 PLOG(ERROR) << "close"; |
| 731 if (HANDLE_EINTR(close(childs_lifeline_fd_)) < 0) | 737 if (HANDLE_EINTR(close(childs_lifeline_fd_)) < 0) |
| 732 PLOG(ERROR) << "close"; | 738 PLOG(ERROR) << "close"; |
| 733 } | 739 } |
| 734 } | 740 } |
| 735 | 741 |
| 736 } // namespace content | 742 } // namespace content |
| OLD | NEW |