Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(380)

Side by Side Diff: content/browser/renderer_host/render_sandbox_host_linux.cc

Issue 291173009: SandboxIPCProcess: make shutdown mechanism explicit. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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
OLDNEW
« no previous file with comments | « content/browser/renderer_host/render_sandbox_host_linux.h ('k') | content/browser/renderer_host/sandbox_ipc_linux.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698