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

Side by Side Diff: ipc/ipc_channel_posix.cc

Issue 1321803003: ipc: Make sure that ChannelReader is destroyed correctly. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@ipc_add_header4
Patch Set: Rebase against top of tree. Created 5 years, 3 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
« no previous file with comments | « ipc/ipc_channel_nacl.cc ('k') | ipc/ipc_channel_reader.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "ipc/ipc_channel_posix.h" 5 #include "ipc/ipc_channel_posix.h"
6 6
7 #include <errno.h> 7 #include <errno.h>
8 #include <fcntl.h> 8 #include <fcntl.h>
9 #include <stddef.h> 9 #include <stddef.h>
10 #include <stdint.h> 10 #include <stdint.h>
(...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after
199 if (!CreatePipe(channel_handle)) { 199 if (!CreatePipe(channel_handle)) {
200 // The pipe may have been closed already. 200 // The pipe may have been closed already.
201 const char *modestr = (mode_ & MODE_SERVER_FLAG) ? "server" : "client"; 201 const char *modestr = (mode_ & MODE_SERVER_FLAG) ? "server" : "client";
202 LOG(WARNING) << "Unable to create pipe named \"" << channel_handle.name 202 LOG(WARNING) << "Unable to create pipe named \"" << channel_handle.name
203 << "\" in " << modestr << " mode"; 203 << "\" in " << modestr << " mode";
204 } 204 }
205 } 205 }
206 206
207 ChannelPosix::~ChannelPosix() { 207 ChannelPosix::~ChannelPosix() {
208 in_dtor_ = true; 208 in_dtor_ = true;
209 CleanUp();
209 Close(); 210 Close();
210 } 211 }
211 212
212 bool SocketPair(int* fd1, int* fd2) { 213 bool SocketPair(int* fd1, int* fd2) {
213 int pipe_fds[2]; 214 int pipe_fds[2];
214 if (socketpair(AF_UNIX, SOCK_STREAM, 0, pipe_fds) != 0) { 215 if (socketpair(AF_UNIX, SOCK_STREAM, 0, pipe_fds) != 0) {
215 PLOG(ERROR) << "socketpair()"; 216 PLOG(ERROR) << "socketpair()";
216 return false; 217 return false;
217 } 218 }
218 219
(...skipping 826 matching lines...) Expand 10 before | Expand all | Expand 10 after
1045 } 1046 }
1046 1047
1047 #if defined(OS_LINUX) 1048 #if defined(OS_LINUX)
1048 // static 1049 // static
1049 void Channel::SetGlobalPid(int pid) { 1050 void Channel::SetGlobalPid(int pid) {
1050 ChannelPosix::SetGlobalPid(pid); 1051 ChannelPosix::SetGlobalPid(pid);
1051 } 1052 }
1052 #endif // OS_LINUX 1053 #endif // OS_LINUX
1053 1054
1054 } // namespace IPC 1055 } // namespace IPC
OLDNEW
« no previous file with comments | « ipc/ipc_channel_nacl.cc ('k') | ipc/ipc_channel_reader.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698