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

Side by Side Diff: ipc/ipc_channel_posix.cc

Issue 1414503009: IPC: Remove unnecessary conversions of BrokerableAttachment. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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 #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 679 matching lines...) Expand 10 before | Expand all | Expand 10 after
690 ClosePipeOnError(); 690 ClosePipeOnError();
691 } 691 }
692 } 692 }
693 693
694 bool ChannelPosix::ProcessMessageForDelivery(Message* message) { 694 bool ChannelPosix::ProcessMessageForDelivery(Message* message) {
695 // Sending a brokerable attachment requires a call to Channel::Send(), so 695 // Sending a brokerable attachment requires a call to Channel::Send(), so
696 // Send() may be re-entrant. 696 // Send() may be re-entrant.
697 if (message->HasBrokerableAttachments()) { 697 if (message->HasBrokerableAttachments()) {
698 DCHECK(GetAttachmentBroker()); 698 DCHECK(GetAttachmentBroker());
699 DCHECK(peer_pid_ != base::kNullProcessId); 699 DCHECK(peer_pid_ != base::kNullProcessId);
700 for (BrokerableAttachment* attachment : 700 for (const scoped_refptr<IPC::BrokerableAttachment>& attachment :
701 message->attachment_set()->GetBrokerableAttachments()) { 701 message->attachment_set()->GetBrokerableAttachments()) {
702 if (!GetAttachmentBroker()->SendAttachmentToProcess(attachment, 702 if (!GetAttachmentBroker()->SendAttachmentToProcess(attachment,
703 peer_pid_)) { 703 peer_pid_)) {
704 delete message; 704 delete message;
705 return false; 705 return false;
706 } 706 }
707 } 707 }
708 } 708 }
709 709
710 #ifdef IPC_MESSAGE_LOG_ENABLED 710 #ifdef IPC_MESSAGE_LOG_ENABLED
(...skipping 408 matching lines...) Expand 10 before | Expand all | Expand 10 after
1119 } 1119 }
1120 1120
1121 #if defined(OS_LINUX) 1121 #if defined(OS_LINUX)
1122 // static 1122 // static
1123 void Channel::SetGlobalPid(int pid) { 1123 void Channel::SetGlobalPid(int pid) {
1124 ChannelPosix::SetGlobalPid(pid); 1124 ChannelPosix::SetGlobalPid(pid);
1125 } 1125 }
1126 #endif // OS_LINUX 1126 #endif // OS_LINUX
1127 1127
1128 } // namespace IPC 1128 } // namespace IPC
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698