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

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: jar feedback 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
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 690 matching lines...) Expand 10 before | Expand all | Expand 10 after
701 } 701 }
702 702
703 m.file_descriptor_set()->SetDescriptors( 703 m.file_descriptor_set()->SetDescriptors(
704 &fds[fds_i], header_fds); 704 &fds[fds_i], header_fds);
705 fds_i += header_fds; 705 fds_i += header_fds;
706 } 706 }
707 DVLOG(2) << "received message on channel @" << this 707 DVLOG(2) << "received message on channel @" << this
708 << " with type " << m.type() << " on fd " << pipe_; 708 << " with type " << m.type() << " on fd " << pipe_;
709 if (IsHelloMessage(&m)) { 709 if (IsHelloMessage(&m)) {
710 // The Hello message contains only the process id. 710 // The Hello message contains only the process id.
711 void *iter = NULL; 711 PickleReader iter(m);
712 int pid; 712 int pid;
713 if (!m.ReadInt(&iter, &pid)) { 713 if (!m.ReadInt(&iter, &pid)) {
714 NOTREACHED(); 714 NOTREACHED();
715 } 715 }
716 #if defined(IPC_USES_READWRITE) 716 #if defined(IPC_USES_READWRITE)
717 if (mode_ & MODE_SERVER_FLAG) { 717 if (mode_ & MODE_SERVER_FLAG) {
718 // With IPC_USES_READWRITE, the Hello message from the client to the 718 // With IPC_USES_READWRITE, the Hello message from the client to the
719 // server also contains the fd_pipe_, which will be used for all 719 // server also contains the fd_pipe_, which will be used for all
720 // subsequent file descriptor passing. 720 // subsequent file descriptor passing.
721 DCHECK_EQ(m.file_descriptor_set()->size(), 1U); 721 DCHECK_EQ(m.file_descriptor_set()->size(), 1U);
(...skipping 531 matching lines...) Expand 10 before | Expand all | Expand 10 after
1253 } 1253 }
1254 1254
1255 #if defined(OS_LINUX) 1255 #if defined(OS_LINUX)
1256 // static 1256 // static
1257 void Channel::SetGlobalPid(int pid) { 1257 void Channel::SetGlobalPid(int pid) {
1258 ChannelImpl::SetGlobalPid(pid); 1258 ChannelImpl::SetGlobalPid(pid);
1259 } 1259 }
1260 #endif // OS_LINUX 1260 #endif // OS_LINUX
1261 1261
1262 } // namespace IPC 1262 } // namespace IPC
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698