OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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_socket_adapter.h" | 5 #include "remoting/protocol/channel_socket_adapter.h" |
6 | 6 |
7 #include <limits> | 7 #include <limits> |
8 | 8 |
9 #include "base/callback.h" | 9 #include "base/callback.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 10 matching lines...) Expand all Loading... |
21 | 21 |
22 channel_->SignalReadPacket.connect( | 22 channel_->SignalReadPacket.connect( |
23 this, &TransportChannelSocketAdapter::OnNewPacket); | 23 this, &TransportChannelSocketAdapter::OnNewPacket); |
24 channel_->SignalWritableState.connect( | 24 channel_->SignalWritableState.connect( |
25 this, &TransportChannelSocketAdapter::OnWritableState); | 25 this, &TransportChannelSocketAdapter::OnWritableState); |
26 channel_->SignalDestroyed.connect( | 26 channel_->SignalDestroyed.connect( |
27 this, &TransportChannelSocketAdapter::OnChannelDestroyed); | 27 this, &TransportChannelSocketAdapter::OnChannelDestroyed); |
28 } | 28 } |
29 | 29 |
30 TransportChannelSocketAdapter::~TransportChannelSocketAdapter() { | 30 TransportChannelSocketAdapter::~TransportChannelSocketAdapter() { |
| 31 DCHECK(thread_checker_.CalledOnValidThread()); |
31 if (!destruction_callback_.is_null()) | 32 if (!destruction_callback_.is_null()) |
32 destruction_callback_.Run(); | 33 destruction_callback_.Run(); |
33 } | 34 } |
34 | 35 |
35 void TransportChannelSocketAdapter::SetOnDestroyedCallback( | 36 void TransportChannelSocketAdapter::SetOnDestroyedCallback( |
36 const base::Closure& callback) { | 37 const base::Closure& callback) { |
37 destruction_callback_ = callback; | 38 destruction_callback_ = callback; |
38 } | 39 } |
39 | 40 |
40 int TransportChannelSocketAdapter::Recv( | 41 int TransportChannelSocketAdapter::Recv( |
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
175 | 176 |
176 void TransportChannelSocketAdapter::OnChannelDestroyed( | 177 void TransportChannelSocketAdapter::OnChannelDestroyed( |
177 cricket::IceTransportInternal* channel) { | 178 cricket::IceTransportInternal* channel) { |
178 DCHECK(thread_checker_.CalledOnValidThread()); | 179 DCHECK(thread_checker_.CalledOnValidThread()); |
179 DCHECK_EQ(channel, channel_); | 180 DCHECK_EQ(channel, channel_); |
180 Close(net::ERR_CONNECTION_ABORTED); | 181 Close(net::ERR_CONNECTION_ABORTED); |
181 } | 182 } |
182 | 183 |
183 } // namespace protocol | 184 } // namespace protocol |
184 } // namespace remoting | 185 } // namespace remoting |
OLD | NEW |