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

Side by Side Diff: ipc/ipc_channel_posix.cc

Issue 9447084: Refactor Pickle Read methods to use higher performance PickleIterator. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: compile (racing with incoming CLs) Created 8 years, 9 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 | Annotate | Revision Log
« no previous file with comments | « gpu/ipc/gpu_command_buffer_traits.cc ('k') | ipc/ipc_fuzzing_tests.cc » ('j') | 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 <sys/types.h> 10 #include <sys/types.h>
(...skipping 1108 matching lines...) Expand 10 before | Expand all | Expand 10 after
1119 void Channel::ChannelImpl::ClearInputFDs() { 1119 void Channel::ChannelImpl::ClearInputFDs() {
1120 while (!input_fds_.empty()) { 1120 while (!input_fds_.empty()) {
1121 if (HANDLE_EINTR(close(input_fds_.front())) < 0) 1121 if (HANDLE_EINTR(close(input_fds_.front())) < 0)
1122 PLOG(ERROR) << "close "; 1122 PLOG(ERROR) << "close ";
1123 input_fds_.pop_front(); 1123 input_fds_.pop_front();
1124 } 1124 }
1125 } 1125 }
1126 1126
1127 void Channel::ChannelImpl::HandleHelloMessage(const Message& msg) { 1127 void Channel::ChannelImpl::HandleHelloMessage(const Message& msg) {
1128 // The Hello message contains only the process id. 1128 // The Hello message contains only the process id.
1129 void *iter = NULL; 1129 PickleIterator iter(msg);
1130 int pid; 1130 int pid;
1131 if (!msg.ReadInt(&iter, &pid)) 1131 if (!msg.ReadInt(&iter, &pid))
1132 NOTREACHED(); 1132 NOTREACHED();
1133 1133
1134 #if defined(IPC_USES_READWRITE) 1134 #if defined(IPC_USES_READWRITE)
1135 if (mode_ & MODE_SERVER_FLAG) { 1135 if (mode_ & MODE_SERVER_FLAG) {
1136 // With IPC_USES_READWRITE, the Hello message from the client to the 1136 // With IPC_USES_READWRITE, the Hello message from the client to the
1137 // server also contains the fd_pipe_, which will be used for all 1137 // server also contains the fd_pipe_, which will be used for all
1138 // subsequent file descriptor passing. 1138 // subsequent file descriptor passing.
1139 DCHECK_EQ(msg.file_descriptor_set()->size(), 1U); 1139 DCHECK_EQ(msg.file_descriptor_set()->size(), 1U);
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
1226 } 1226 }
1227 1227
1228 #if defined(OS_LINUX) 1228 #if defined(OS_LINUX)
1229 // static 1229 // static
1230 void Channel::SetGlobalPid(int pid) { 1230 void Channel::SetGlobalPid(int pid) {
1231 ChannelImpl::SetGlobalPid(pid); 1231 ChannelImpl::SetGlobalPid(pid);
1232 } 1232 }
1233 #endif // OS_LINUX 1233 #endif // OS_LINUX
1234 1234
1235 } // namespace IPC 1235 } // namespace IPC
OLDNEW
« no previous file with comments | « gpu/ipc/gpu_command_buffer_traits.cc ('k') | ipc/ipc_fuzzing_tests.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698