OLD | NEW |
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 999 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1010 case Channel::HELLO_MESSAGE_TYPE: | 1010 case Channel::HELLO_MESSAGE_TYPE: |
1011 int pid; | 1011 int pid; |
1012 if (!iter.ReadInt(&pid)) | 1012 if (!iter.ReadInt(&pid)) |
1013 NOTREACHED(); | 1013 NOTREACHED(); |
1014 | 1014 |
1015 peer_pid_ = pid; | 1015 peer_pid_ = pid; |
1016 listener()->OnChannelConnected(pid); | 1016 listener()->OnChannelConnected(pid); |
1017 | 1017 |
1018 if (!FlushPrelimQueue()) | 1018 if (!FlushPrelimQueue()) |
1019 ClosePipeOnError(); | 1019 ClosePipeOnError(); |
| 1020 |
| 1021 if (IsAttachmentBrokerEndpoint() && |
| 1022 AttachmentBroker::GetGlobal() && |
| 1023 AttachmentBroker::GetGlobal()->IsPrivilegedBroker()) { |
| 1024 AttachmentBroker::GetGlobal()->ReceivedPeerPid(pid); |
| 1025 } |
1020 break; | 1026 break; |
1021 | 1027 |
1022 #if defined(OS_MACOSX) | 1028 #if defined(OS_MACOSX) |
1023 case Channel::CLOSE_FD_MESSAGE_TYPE: | 1029 case Channel::CLOSE_FD_MESSAGE_TYPE: |
1024 int fd, hops; | 1030 int fd, hops; |
1025 if (!iter.ReadInt(&hops)) | 1031 if (!iter.ReadInt(&hops)) |
1026 NOTREACHED(); | 1032 NOTREACHED(); |
1027 if (!iter.ReadInt(&fd)) | 1033 if (!iter.ReadInt(&fd)) |
1028 NOTREACHED(); | 1034 NOTREACHED(); |
1029 if (hops == 0) { | 1035 if (hops == 0) { |
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1133 // static | 1139 // static |
1134 void Channel::SetGlobalPid(int pid) { | 1140 void Channel::SetGlobalPid(int pid) { |
1135 ChannelPosix::SetGlobalPid(pid); | 1141 ChannelPosix::SetGlobalPid(pid); |
1136 } | 1142 } |
1137 int Channel::GetGlobalPid() { | 1143 int Channel::GetGlobalPid() { |
1138 return ChannelPosix::GetGlobalPid(); | 1144 return ChannelPosix::GetGlobalPid(); |
1139 } | 1145 } |
1140 #endif // OS_LINUX | 1146 #endif // OS_LINUX |
1141 | 1147 |
1142 } // namespace IPC | 1148 } // namespace IPC |
OLD | NEW |