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

Side by Side Diff: ipc/ipc_channel_posix.h

Issue 695353005: Non-SFI mode: Use dummy PID for NaCl's IPC channel on Linux platform. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 1 month 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
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 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
78 // for more connections. 78 // for more connections.
79 void ResetToAcceptingConnectionState(); 79 void ResetToAcceptingConnectionState();
80 80
81 // Returns true if the peer process' effective user id can be determined, in 81 // Returns true if the peer process' effective user id can be determined, in
82 // which case the supplied peer_euid is updated with it. 82 // which case the supplied peer_euid is updated with it.
83 bool GetPeerEuid(uid_t* peer_euid) const; 83 bool GetPeerEuid(uid_t* peer_euid) const;
84 84
85 void CloseClientFileDescriptor(); 85 void CloseClientFileDescriptor();
86 86
87 static bool IsNamedServerInitialized(const std::string& channel_id); 87 static bool IsNamedServerInitialized(const std::string& channel_id);
88 #if defined(OS_LINUX) 88 #if defined(OS_LINUX) || defined(OS_NACL_NONSFI)
89 static void SetGlobalPid(int pid); 89 static void SetGlobalPid(int pid);
90 #endif // OS_LINUX 90 #endif // defined(OS_LINUX) || defined(OS_NACL_NONSFI)
91 91
92 private: 92 private:
93 bool CreatePipe(const IPC::ChannelHandle& channel_handle); 93 bool CreatePipe(const IPC::ChannelHandle& channel_handle);
94 94
95 bool ProcessOutgoingMessages(); 95 bool ProcessOutgoingMessages();
96 96
97 bool AcceptConnection(); 97 bool AcceptConnection();
98 void ClosePipeOnError(); 98 void ClosePipeOnError();
99 int GetHelloMessageProcId() const; 99 int GetHelloMessageProcId() const;
100 void QueueHelloMessage(); 100 void QueueHelloMessage();
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
205 #if defined(OS_MACOSX) 205 #if defined(OS_MACOSX)
206 // On OSX, sent FDs must not be closed until we get an ack. 206 // 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 207 // Keep track of sent FDs here to make sure the remote is not
208 // trying to bamboozle us. 208 // trying to bamboozle us.
209 std::set<int> fds_to_close_; 209 std::set<int> fds_to_close_;
210 #endif 210 #endif
211 211
212 // True if we are responsible for unlinking the unix domain socket file. 212 // True if we are responsible for unlinking the unix domain socket file.
213 bool must_unlink_; 213 bool must_unlink_;
214 214
215 #if defined(OS_LINUX) 215 #if defined(OS_LINUX) || defined(OS_NACL_NONSFI)
216 // If non-zero, overrides the process ID sent in the hello message. 216 // If non-zero, overrides the process ID sent in the hello message.
217 static int global_pid_; 217 static int global_pid_;
218 #endif // OS_LINUX 218 #endif // defined(OS_LINUX) || defined(OS_NACL_NONSFI)
219 219
220 DISALLOW_IMPLICIT_CONSTRUCTORS(ChannelPosix); 220 DISALLOW_IMPLICIT_CONSTRUCTORS(ChannelPosix);
221 }; 221 };
222 222
223 } // namespace IPC 223 } // namespace IPC
224 224
225 #endif // IPC_IPC_CHANNEL_POSIX_H_ 225 #endif // IPC_IPC_CHANNEL_POSIX_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698