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

Side by Side Diff: ipc/ipc_channel_posix.cc

Issue 1978353003: mac: Fix an attachment broker race condition. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@temp48_windows_ab
Patch Set: Created 4 years, 7 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/attachment_broker_privileged_mac.cc ('k') | no next file » | 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 999 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
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
OLDNEW
« no previous file with comments | « ipc/attachment_broker_privileged_mac.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698