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

Side by Side Diff: ipc/ipc_channel_posix.cc

Issue 1206093002: Update ChannelReader to use AttachmentBroker. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@attachment_broker3_listener
Patch Set: Created 5 years, 6 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
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 <sys/socket.h> 10 #include <sys/socket.h>
(...skipping 780 matching lines...) Expand 10 before | Expand all | Expand 10 after
791 DCHECK(*bytes_read); 791 DCHECK(*bytes_read);
792 792
793 CloseClientFileDescriptor(); 793 CloseClientFileDescriptor();
794 794
795 // Read any file descriptors from the message. 795 // Read any file descriptors from the message.
796 if (!ExtractFileDescriptorsFromMsghdr(&msg)) 796 if (!ExtractFileDescriptorsFromMsghdr(&msg))
797 return READ_FAILED; 797 return READ_FAILED;
798 return READ_SUCCEEDED; 798 return READ_SUCCEEDED;
799 } 799 }
800 800
801 bool ChannelPosix::ShouldDispatchInputMessage(Message* msg) {
802 return true;
803 }
804
801 // On Posix, we need to fix up the file descriptors before the input message 805 // On Posix, we need to fix up the file descriptors before the input message
802 // is dispatched. 806 // is dispatched.
803 // 807 //
804 // This will read from the input_fds_ (READWRITE mode only) and read more 808 // This will read from the input_fds_ (READWRITE mode only) and read more
805 // handles from the FD pipe if necessary. 809 // handles from the FD pipe if necessary.
806 bool ChannelPosix::WillDispatchInputMessage(Message* msg) { 810 bool ChannelPosix::GetNonBrokeredAttachments(Message* msg) {
807 uint16 header_fds = msg->header()->num_fds; 811 uint16 header_fds = msg->header()->num_fds;
808 if (!header_fds) 812 if (!header_fds)
809 return true; // Nothing to do. 813 return true; // Nothing to do.
810 814
811 // The message has file descriptors. 815 // The message has file descriptors.
812 const char* error = NULL; 816 const char* error = NULL;
813 if (header_fds > input_fds_.size()) { 817 if (header_fds > input_fds_.size()) {
814 // The message has been completely received, but we didn't get 818 // The message has been completely received, but we didn't get
815 // enough file descriptors. 819 // enough file descriptors.
816 error = "Message needs unreceived descriptors"; 820 error = "Message needs unreceived descriptors";
(...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after
1028 } 1032 }
1029 1033
1030 #if defined(OS_LINUX) 1034 #if defined(OS_LINUX)
1031 // static 1035 // static
1032 void Channel::SetGlobalPid(int pid) { 1036 void Channel::SetGlobalPid(int pid) {
1033 ChannelPosix::SetGlobalPid(pid); 1037 ChannelPosix::SetGlobalPid(pid);
1034 } 1038 }
1035 #endif // OS_LINUX 1039 #endif // OS_LINUX
1036 1040
1037 } // namespace IPC 1041 } // namespace IPC
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698