| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "remoting/protocol/message_reader.h" | 5 #include "remoting/protocol/message_reader.h" |
| 6 | 6 |
| 7 #include "base/message_loop.h" | 7 #include "base/message_loop.h" |
| 8 #include "net/base/io_buffer.h" | 8 #include "net/base/io_buffer.h" |
| 9 #include "net/base/net_errors.h" | 9 #include "net/base/net_errors.h" |
| 10 #include "net/socket/socket.h" | 10 #include "net/socket/socket.h" |
| 11 #include "remoting/base/multiple_array_input_stream.h" | 11 #include "remoting/base/multiple_array_input_stream.h" |
| 12 #include "remoting/proto/internal.pb.h" | 12 #include "remoting/proto/internal.pb.h" |
| 13 #include "remoting/protocol/chromotocol_connection.h" | |
| 14 | 13 |
| 15 namespace remoting { | 14 namespace remoting { |
| 16 | 15 |
| 17 static const int kReadBufferSize = 4096; | 16 static const int kReadBufferSize = 4096; |
| 18 | 17 |
| 19 MessageReader::MessageReader() | 18 MessageReader::MessageReader() |
| 20 : socket_(NULL), | 19 : socket_(NULL), |
| 21 closed_(false), | 20 closed_(false), |
| 22 ALLOW_THIS_IN_INITIALIZER_LIST( | 21 ALLOW_THIS_IN_INITIALIZER_LIST( |
| 23 read_callback_(this, &MessageReader::OnRead)) { | 22 read_callback_(this, &MessageReader::OnRead)) { |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 60 void MessageReader::HandleReadResult(int result) { | 59 void MessageReader::HandleReadResult(int result) { |
| 61 if (result > 0) { | 60 if (result > 0) { |
| 62 data_received_callback_->Run(read_buffer_, result); | 61 data_received_callback_->Run(read_buffer_, result); |
| 63 } else { | 62 } else { |
| 64 if (result != net::ERR_IO_PENDING) | 63 if (result != net::ERR_IO_PENDING) |
| 65 LOG(ERROR) << "Read() returned error " << result; | 64 LOG(ERROR) << "Read() returned error " << result; |
| 66 } | 65 } |
| 67 } | 66 } |
| 68 | 67 |
| 69 } // namespace remoting | 68 } // namespace remoting |
| OLD | NEW |