| 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 "remoting/protocol/channel_multiplexer.h" | 5 #include "remoting/protocol/channel_multiplexer.h" |
| 6 | 6 |
| 7 #include <string.h> | 7 #include <string.h> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/callback.h" | 10 #include "base/callback.h" |
| 11 #include "base/location.h" | 11 #include "base/location.h" |
| 12 #include "base/single_thread_task_runner.h" | 12 #include "base/single_thread_task_runner.h" |
| 13 #include "base/stl_util.h" | 13 #include "base/stl_util.h" |
| 14 #include "base/thread_task_runner_handle.h" | 14 #include "base/thread_task_runner_handle.h" |
| 15 #include "net/base/net_errors.h" | 15 #include "net/base/net_errors.h" |
| 16 #include "net/socket/stream_socket.h" | 16 #include "net/socket/stream_socket.h" |
| 17 #include "remoting/protocol/util.h" | 17 #include "remoting/protocol/message_serialization.h" |
| 18 | 18 |
| 19 namespace remoting { | 19 namespace remoting { |
| 20 namespace protocol { | 20 namespace protocol { |
| 21 | 21 |
| 22 namespace { | 22 namespace { |
| 23 const int kChannelIdUnknown = -1; | 23 const int kChannelIdUnknown = -1; |
| 24 const int kMaxPacketSize = 1024; | 24 const int kMaxPacketSize = 1024; |
| 25 | 25 |
| 26 class PendingPacket { | 26 class PendingPacket { |
| 27 public: | 27 public: |
| (...skipping 482 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 510 channel->OnIncomingPacket(packet.Pass(), done_task); | 510 channel->OnIncomingPacket(packet.Pass(), done_task); |
| 511 } | 511 } |
| 512 | 512 |
| 513 bool ChannelMultiplexer::DoWrite(scoped_ptr<MultiplexPacket> packet, | 513 bool ChannelMultiplexer::DoWrite(scoped_ptr<MultiplexPacket> packet, |
| 514 const base::Closure& done_task) { | 514 const base::Closure& done_task) { |
| 515 return writer_.Write(SerializeAndFrameMessage(*packet), done_task); | 515 return writer_.Write(SerializeAndFrameMessage(*packet), done_task); |
| 516 } | 516 } |
| 517 | 517 |
| 518 } // namespace protocol | 518 } // namespace protocol |
| 519 } // namespace remoting | 519 } // namespace remoting |
| OLD | NEW |