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

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

Issue 1197853003: Add P2PDatagramSocket and P2PStreamSocket interfaces. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 5 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/jingle_session_unittest.cc ('k') | remoting/protocol/message_reader.h » ('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 (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/libjingle_transport_factory.h" 5 #include "remoting/protocol/libjingle_transport_factory.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/callback.h" 9 #include "base/callback.h"
10 #include "base/callback_helpers.h" 10 #include "base/callback_helpers.h"
(...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after
229 reconnect_timer_.Start( 229 reconnect_timer_.Start(
230 FROM_HERE, base::TimeDelta::FromSeconds(kReconnectDelaySeconds), 230 FROM_HERE, base::TimeDelta::FromSeconds(kReconnectDelaySeconds),
231 this, &LibjingleTransport::TryReconnect); 231 this, &LibjingleTransport::TryReconnect);
232 232
233 base::ThreadTaskRunnerHandle::Get()->PostTask( 233 base::ThreadTaskRunnerHandle::Get()->PostTask(
234 FROM_HERE, base::Bind(&LibjingleTransport::NotifyConnected, 234 FROM_HERE, base::Bind(&LibjingleTransport::NotifyConnected,
235 weak_factory_.GetWeakPtr())); 235 weak_factory_.GetWeakPtr()));
236 } 236 }
237 237
238 void LibjingleTransport::NotifyConnected() { 238 void LibjingleTransport::NotifyConnected() {
239 // Create net::Socket adapter for the P2PTransportChannel. 239 // Create P2PDatagramSocket adapter for the P2PTransportChannel.
240 scoped_ptr<TransportChannelSocketAdapter> socket( 240 scoped_ptr<TransportChannelSocketAdapter> socket(
241 new TransportChannelSocketAdapter(channel_.get())); 241 new TransportChannelSocketAdapter(channel_.get()));
242 socket->SetOnDestroyedCallback(base::Bind( 242 socket->SetOnDestroyedCallback(base::Bind(
243 &LibjingleTransport::OnChannelDestroyed, base::Unretained(this))); 243 &LibjingleTransport::OnChannelDestroyed, base::Unretained(this)));
244 base::ResetAndReturn(&callback_).Run(socket.Pass()); 244 base::ResetAndReturn(&callback_).Run(socket.Pass());
245 } 245 }
246 246
247 void LibjingleTransport::SetRemoteCredentials(const std::string& ufrag, 247 void LibjingleTransport::SetRemoteCredentials(const std::string& ufrag,
248 const std::string& password) { 248 const std::string& password) {
249 DCHECK(CalledOnValidThread()); 249 DCHECK(CalledOnValidThread());
(...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after
467 last_jingle_info_update_time_ = base::TimeTicks::Now(); 467 last_jingle_info_update_time_ = base::TimeTicks::Now();
468 468
469 while (!on_jingle_info_callbacks_.empty()) { 469 while (!on_jingle_info_callbacks_.empty()) {
470 on_jingle_info_callbacks_.begin()->Run(); 470 on_jingle_info_callbacks_.begin()->Run();
471 on_jingle_info_callbacks_.pop_front(); 471 on_jingle_info_callbacks_.pop_front();
472 } 472 }
473 } 473 }
474 474
475 } // namespace protocol 475 } // namespace protocol
476 } // namespace remoting 476 } // namespace remoting
OLDNEW
« no previous file with comments | « remoting/protocol/jingle_session_unittest.cc ('k') | remoting/protocol/message_reader.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698