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/ice_transport_channel.h" | 5 #include "remoting/protocol/ice_transport_channel.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <utility> | 8 #include <utility> |
9 | 9 |
10 #include "base/callback.h" | 10 #include "base/callback.h" |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
53 ice_username_fragment_( | 53 ice_username_fragment_( |
54 rtc::CreateRandomString(kIceUfragLength)), | 54 rtc::CreateRandomString(kIceUfragLength)), |
55 connect_attempts_left_( | 55 connect_attempts_left_( |
56 transport_context->network_settings().ice_reconnect_attempts), | 56 transport_context->network_settings().ice_reconnect_attempts), |
57 weak_factory_(this) { | 57 weak_factory_(this) { |
58 DCHECK(!ice_username_fragment_.empty()); | 58 DCHECK(!ice_username_fragment_.empty()); |
59 } | 59 } |
60 | 60 |
61 IceTransportChannel::~IceTransportChannel() { | 61 IceTransportChannel::~IceTransportChannel() { |
62 DCHECK(delegate_); | 62 DCHECK(delegate_); |
| 63 DCHECK(thread_checker_.CalledOnValidThread()); |
63 | 64 |
64 delegate_->OnChannelDeleted(this); | 65 delegate_->OnChannelDeleted(this); |
65 | 66 |
66 auto task_runner = base::ThreadTaskRunnerHandle::Get(); | 67 auto task_runner = base::ThreadTaskRunnerHandle::Get(); |
67 if (channel_) | 68 if (channel_) |
68 task_runner->DeleteSoon(FROM_HERE, channel_.release()); | 69 task_runner->DeleteSoon(FROM_HERE, channel_.release()); |
69 if (port_allocator_) | 70 if (port_allocator_) |
70 task_runner->DeleteSoon(FROM_HERE, port_allocator_.release()); | 71 task_runner->DeleteSoon(FROM_HERE, port_allocator_.release()); |
71 } | 72 } |
72 | 73 |
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
270 | 271 |
271 // Restart ICE by resetting ICE password. | 272 // Restart ICE by resetting ICE password. |
272 std::string ice_password = rtc::CreateRandomString(cricket::ICE_PWD_LENGTH); | 273 std::string ice_password = rtc::CreateRandomString(cricket::ICE_PWD_LENGTH); |
273 delegate_->OnChannelIceCredentials(this, ice_username_fragment_, | 274 delegate_->OnChannelIceCredentials(this, ice_username_fragment_, |
274 ice_password); | 275 ice_password); |
275 channel_->SetIceCredentials(ice_username_fragment_, ice_password); | 276 channel_->SetIceCredentials(ice_username_fragment_, ice_password); |
276 } | 277 } |
277 | 278 |
278 } // namespace protocol | 279 } // namespace protocol |
279 } // namespace remoting | 280 } // namespace remoting |
OLD | NEW |