OLD | NEW |
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 Loading... |
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 |
OLD | NEW |