Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(25)

Side by Side Diff: remoting/protocol/ice_transport_channel.cc

Issue 1864213002: Convert //remoting to use std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Mac IWYU Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « remoting/protocol/ice_transport_channel.h ('k') | remoting/protocol/ice_transport_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
127 transport_context_->network_settings().ice_timeout, 127 transport_context_->network_settings().ice_timeout,
128 this, &IceTransportChannel::TryReconnect); 128 this, &IceTransportChannel::TryReconnect);
129 129
130 base::ThreadTaskRunnerHandle::Get()->PostTask( 130 base::ThreadTaskRunnerHandle::Get()->PostTask(
131 FROM_HERE, base::Bind(&IceTransportChannel::NotifyConnected, 131 FROM_HERE, base::Bind(&IceTransportChannel::NotifyConnected,
132 weak_factory_.GetWeakPtr())); 132 weak_factory_.GetWeakPtr()));
133 } 133 }
134 134
135 void IceTransportChannel::NotifyConnected() { 135 void IceTransportChannel::NotifyConnected() {
136 // Create P2PDatagramSocket adapter for the P2PTransportChannel. 136 // Create P2PDatagramSocket adapter for the P2PTransportChannel.
137 scoped_ptr<TransportChannelSocketAdapter> socket( 137 std::unique_ptr<TransportChannelSocketAdapter> socket(
138 new TransportChannelSocketAdapter(channel_.get())); 138 new TransportChannelSocketAdapter(channel_.get()));
139 socket->SetOnDestroyedCallback(base::Bind( 139 socket->SetOnDestroyedCallback(base::Bind(
140 &IceTransportChannel::OnChannelDestroyed, base::Unretained(this))); 140 &IceTransportChannel::OnChannelDestroyed, base::Unretained(this)));
141 base::ResetAndReturn(&callback_).Run(std::move(socket)); 141 base::ResetAndReturn(&callback_).Run(std::move(socket));
142 } 142 }
143 143
144 void IceTransportChannel::SetRemoteCredentials(const std::string& ufrag, 144 void IceTransportChannel::SetRemoteCredentials(const std::string& ufrag,
145 const std::string& password) { 145 const std::string& password) {
146 DCHECK(thread_checker_.CalledOnValidThread()); 146 DCHECK(thread_checker_.CalledOnValidThread());
147 147
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after
266 266
267 // Restart ICE by resetting ICE password. 267 // Restart ICE by resetting ICE password.
268 std::string ice_password = rtc::CreateRandomString(cricket::ICE_PWD_LENGTH); 268 std::string ice_password = rtc::CreateRandomString(cricket::ICE_PWD_LENGTH);
269 delegate_->OnChannelIceCredentials(this, ice_username_fragment_, 269 delegate_->OnChannelIceCredentials(this, ice_username_fragment_,
270 ice_password); 270 ice_password);
271 channel_->SetIceCredentials(ice_username_fragment_, ice_password); 271 channel_->SetIceCredentials(ice_username_fragment_, ice_password);
272 } 272 }
273 273
274 } // namespace protocol 274 } // namespace protocol
275 } // namespace remoting 275 } // namespace remoting
OLDNEW
« no previous file with comments | « remoting/protocol/ice_transport_channel.h ('k') | remoting/protocol/ice_transport_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698