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 <sys/socket.h> | 7 #include <sys/socket.h> |
8 | 8 |
9 #include "base/memory/singleton.h" | 9 #include "base/memory/singleton.h" |
10 #include "base/posix/eintr_wrapper.h" | 10 #include "base/posix/eintr_wrapper.h" |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
63 DPLOG(ERROR) << "close"; | 63 DPLOG(ERROR) << "close"; |
64 if (IGNORE_EINTR(close(pipefds[1])) < 0) | 64 if (IGNORE_EINTR(close(pipefds[1])) < 0) |
65 DPLOG(ERROR) << "close"; | 65 DPLOG(ERROR) << "close"; |
66 | 66 |
67 SandboxIPCProcess handler(child_lifeline_fd, browser_socket); | 67 SandboxIPCProcess handler(child_lifeline_fd, browser_socket); |
68 handler.Run(); | 68 handler.Run(); |
69 _exit(0); | 69 _exit(0); |
70 } | 70 } |
71 } | 71 } |
72 | 72 |
| 73 bool RenderSandboxHostLinux::ShutdownIPCChannel() { |
| 74 return IGNORE_EINTR(close(childs_lifeline_fd_)) == 0; |
| 75 } |
| 76 |
73 RenderSandboxHostLinux::~RenderSandboxHostLinux() { | 77 RenderSandboxHostLinux::~RenderSandboxHostLinux() { |
74 if (initialized_) { | 78 if (initialized_) { |
| 79 if (!ShutdownIPCChannel()) |
| 80 LOG(ERROR) << "ShutdownIPCChannel failed"; |
75 if (IGNORE_EINTR(close(renderer_socket_)) < 0) | 81 if (IGNORE_EINTR(close(renderer_socket_)) < 0) |
76 PLOG(ERROR) << "close"; | 82 PLOG(ERROR) << "close"; |
77 if (IGNORE_EINTR(close(childs_lifeline_fd_)) < 0) | |
78 PLOG(ERROR) << "close"; | |
79 } | 83 } |
80 } | 84 } |
81 | 85 |
82 } // namespace content | 86 } // namespace content |
OLD | NEW |