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

Side by Side Diff: ipc/ipc_channel_reader.cc

Issue 10541065: Separate out IPC::Message::Sender and channel::Listener into a separate class. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: de-inline Created 8 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 | Annotate | Revision Log
« no previous file with comments | « ipc/ipc_channel_reader.h ('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_reader.h" 5 #include "ipc/ipc_channel_reader.h"
6 6
7 namespace IPC { 7 namespace IPC {
8 namespace internal { 8 namespace internal {
9 9
10 ChannelReader::ChannelReader(Channel::Listener* listener) 10 ChannelReader::ChannelReader(Listener* listener) : listener_(listener) {
11 : listener_(listener) {
12 memset(input_buf_, 0, sizeof(input_buf_)); 11 memset(input_buf_, 0, sizeof(input_buf_));
13 } 12 }
14 13
15 ChannelReader::~ChannelReader() { 14 ChannelReader::~ChannelReader() {
16 } 15 }
17 16
18 bool ChannelReader::ProcessIncomingMessages() { 17 bool ChannelReader::ProcessIncomingMessages() {
19 while (true) { 18 while (true) {
20 int bytes_read = 0; 19 int bytes_read = 0;
21 ReadState read_state = ReadData(input_buf_, Channel::kReadBufferSize, 20 ReadState read_state = ReadData(input_buf_, Channel::kReadBufferSize,
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
85 input_overflow_buf_.assign(p, end - p); 84 input_overflow_buf_.assign(p, end - p);
86 85
87 if (input_overflow_buf_.empty() && !DidEmptyInputBuffers()) 86 if (input_overflow_buf_.empty() && !DidEmptyInputBuffers())
88 return false; 87 return false;
89 return true; 88 return true;
90 } 89 }
91 90
92 91
93 } // namespace internal 92 } // namespace internal
94 } // namespace IPC 93 } // namespace IPC
OLDNEW
« no previous file with comments | « ipc/ipc_channel_reader.h ('k') | ipc/ipc_fuzzing_tests.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698