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

Side by Side Diff: ipc/ipc_channel_posix.h

Issue 882543002: Add ChannelPosix::ResetSafely() to deal with a lingering crash (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Landing Created 5 years, 10 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 | « no previous file | ipc/ipc_channel_posix.cc » ('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 #ifndef IPC_IPC_CHANNEL_POSIX_H_ 5 #ifndef IPC_IPC_CHANNEL_POSIX_H_
6 #define IPC_IPC_CHANNEL_POSIX_H_ 6 #define IPC_IPC_CHANNEL_POSIX_H_
7 7
8 #include "ipc/ipc_channel.h" 8 #include "ipc/ipc_channel.h"
9 9
10 #include <sys/socket.h> // for CMSG macros 10 #include <sys/socket.h> // for CMSG macros
(...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after
195 char input_cmsg_buf_[kMaxReadFDBuffer]; 195 char input_cmsg_buf_[kMaxReadFDBuffer];
196 196
197 // File descriptors extracted from messages coming off of the channel. The 197 // File descriptors extracted from messages coming off of the channel. The
198 // handles may span messages and come off different channels from the message 198 // handles may span messages and come off different channels from the message
199 // data (in the case of READWRITE), and are processed in FIFO here. 199 // data (in the case of READWRITE), and are processed in FIFO here.
200 // NOTE: The implementation assumes underlying storage here is contiguous, so 200 // NOTE: The implementation assumes underlying storage here is contiguous, so
201 // don't change to something like std::deque<> without changing the 201 // don't change to something like std::deque<> without changing the
202 // implementation! 202 // implementation!
203 std::vector<int> input_fds_; 203 std::vector<int> input_fds_;
204 204
205
206 void ResetSafely(base::ScopedFD* fd);
207 bool in_dtor_;
208
205 #if defined(OS_MACOSX) 209 #if defined(OS_MACOSX)
206 // On OSX, sent FDs must not be closed until we get an ack. 210 // On OSX, sent FDs must not be closed until we get an ack.
207 // Keep track of sent FDs here to make sure the remote is not 211 // Keep track of sent FDs here to make sure the remote is not
208 // trying to bamboozle us. 212 // trying to bamboozle us.
209 std::set<int> fds_to_close_; 213 std::set<int> fds_to_close_;
210 #endif 214 #endif
211 215
212 // True if we are responsible for unlinking the unix domain socket file. 216 // True if we are responsible for unlinking the unix domain socket file.
213 bool must_unlink_; 217 bool must_unlink_;
214 218
215 #if defined(OS_LINUX) 219 #if defined(OS_LINUX)
216 // If non-zero, overrides the process ID sent in the hello message. 220 // If non-zero, overrides the process ID sent in the hello message.
217 static int global_pid_; 221 static int global_pid_;
218 #endif // OS_LINUX 222 #endif // OS_LINUX
219 223
220 DISALLOW_IMPLICIT_CONSTRUCTORS(ChannelPosix); 224 DISALLOW_IMPLICIT_CONSTRUCTORS(ChannelPosix);
221 }; 225 };
222 226
223 } // namespace IPC 227 } // namespace IPC
224 228
225 #endif // IPC_IPC_CHANNEL_POSIX_H_ 229 #endif // IPC_IPC_CHANNEL_POSIX_H_
OLDNEW
« no previous file with comments | « no previous file | ipc/ipc_channel_posix.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698