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

Unified Diff: ipc/ipc_channel_posix.h

Issue 25325002: workaround for mac kernel bug (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: minor bugfix Created 7 years, 2 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ipc/ipc_channel_nacl.cc ('k') | ipc/ipc_channel_posix.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ipc/ipc_channel_posix.h
diff --git a/ipc/ipc_channel_posix.h b/ipc/ipc_channel_posix.h
index 645a1303713116f188b037c5f537bee272444607..1e587c13eb0d02e8737db4d6c088659356656e3e 100644
--- a/ipc/ipc_channel_posix.h
+++ b/ipc/ipc_channel_posix.h
@@ -10,6 +10,7 @@
#include <sys/socket.h> // for CMSG macros
#include <queue>
+#include <set>
#include <string>
#include <vector>
@@ -80,6 +81,8 @@ class Channel::ChannelImpl : public internal::ChannelReader,
void ClosePipeOnError();
int GetHelloMessageProcId();
void QueueHelloMessage();
+ void CloseFileDescriptors(Message* msg);
+ void QueueCloseFDMessage(int fd, int hops);
// ChannelReader implementation.
virtual ReadState ReadData(char* buffer,
@@ -87,7 +90,7 @@ class Channel::ChannelImpl : public internal::ChannelReader,
int* bytes_read) OVERRIDE;
virtual bool WillDispatchInputMessage(Message* msg) OVERRIDE;
virtual bool DidEmptyInputBuffers() OVERRIDE;
- virtual void HandleHelloMessage(const Message& msg) OVERRIDE;
+ virtual void HandleInternalMessage(const Message& msg) OVERRIDE;
#if defined(IPC_USES_READWRITE)
// Reads the next message from the fd_pipe_ and appends them to the
@@ -184,6 +187,13 @@ class Channel::ChannelImpl : public internal::ChannelReader,
// implementation!
std::vector<int> input_fds_;
+#if defined(OS_MACOSX)
+ // On OSX, sent FDs must not be closed until we get an ack.
+ // Keep track of sent FDs here to make sure the remote is not
+ // trying to bamboozle us.
+ std::set<int> fds_to_close_;
+#endif
+
// True if we are responsible for unlinking the unix domain socket file.
bool must_unlink_;
« no previous file with comments | « ipc/ipc_channel_nacl.cc ('k') | ipc/ipc_channel_posix.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698