| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2015 The WebRTC Project Authors. All rights reserved. | 2 * Copyright 2015 The WebRTC Project Authors. All rights reserved. |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
| 5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
| 6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
| 7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
| 8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
| 9 */ | 9 */ |
| 10 | 10 |
| 11 #include "webrtc/p2p/base/transportcontroller.h" | 11 #include "webrtc/p2p/base/transportcontroller.h" |
| 12 | 12 |
| 13 #include <algorithm> | 13 #include <algorithm> |
| 14 #include <memory> |
| 14 | 15 |
| 15 #include "webrtc/base/bind.h" | 16 #include "webrtc/base/bind.h" |
| 16 #include "webrtc/base/checks.h" | 17 #include "webrtc/base/checks.h" |
| 17 #include "webrtc/base/thread.h" | 18 #include "webrtc/base/thread.h" |
| 18 #include "webrtc/p2p/base/dtlstransport.h" | 19 #include "webrtc/p2p/base/dtlstransport.h" |
| 19 #include "webrtc/p2p/base/p2ptransport.h" | 20 #include "webrtc/p2p/base/p2ptransport.h" |
| 20 #include "webrtc/p2p/base/port.h" | 21 #include "webrtc/p2p/base/port.h" |
| 21 | 22 |
| 22 namespace cricket { | 23 namespace cricket { |
| 23 | 24 |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 79 } | 80 } |
| 80 | 81 |
| 81 bool TransportController::GetLocalCertificate( | 82 bool TransportController::GetLocalCertificate( |
| 82 const std::string& transport_name, | 83 const std::string& transport_name, |
| 83 rtc::scoped_refptr<rtc::RTCCertificate>* certificate) { | 84 rtc::scoped_refptr<rtc::RTCCertificate>* certificate) { |
| 84 return worker_thread_->Invoke<bool>( | 85 return worker_thread_->Invoke<bool>( |
| 85 rtc::Bind(&TransportController::GetLocalCertificate_w, this, | 86 rtc::Bind(&TransportController::GetLocalCertificate_w, this, |
| 86 transport_name, certificate)); | 87 transport_name, certificate)); |
| 87 } | 88 } |
| 88 | 89 |
| 89 rtc::scoped_ptr<rtc::SSLCertificate> | 90 std::unique_ptr<rtc::SSLCertificate> |
| 90 TransportController::GetRemoteSSLCertificate( | 91 TransportController::GetRemoteSSLCertificate( |
| 91 const std::string& transport_name) { | 92 const std::string& transport_name) { |
| 92 return worker_thread_->Invoke<rtc::scoped_ptr<rtc::SSLCertificate>>(rtc::Bind( | 93 return worker_thread_->Invoke<std::unique_ptr<rtc::SSLCertificate>>(rtc::Bind( |
| 93 &TransportController::GetRemoteSSLCertificate_w, this, transport_name)); | 94 &TransportController::GetRemoteSSLCertificate_w, this, transport_name)); |
| 94 } | 95 } |
| 95 | 96 |
| 96 bool TransportController::SetLocalTransportDescription( | 97 bool TransportController::SetLocalTransportDescription( |
| 97 const std::string& transport_name, | 98 const std::string& transport_name, |
| 98 const TransportDescription& tdesc, | 99 const TransportDescription& tdesc, |
| 99 ContentAction action, | 100 ContentAction action, |
| 100 std::string* err) { | 101 std::string* err) { |
| 101 return worker_thread_->Invoke<bool>( | 102 return worker_thread_->Invoke<bool>( |
| 102 rtc::Bind(&TransportController::SetLocalTransportDescription_w, this, | 103 rtc::Bind(&TransportController::SetLocalTransportDescription_w, this, |
| (...skipping 284 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 387 RTC_DCHECK(worker_thread_->IsCurrent()); | 388 RTC_DCHECK(worker_thread_->IsCurrent()); |
| 388 | 389 |
| 389 Transport* t = GetTransport_w(transport_name); | 390 Transport* t = GetTransport_w(transport_name); |
| 390 if (!t) { | 391 if (!t) { |
| 391 return false; | 392 return false; |
| 392 } | 393 } |
| 393 | 394 |
| 394 return t->GetLocalCertificate(certificate); | 395 return t->GetLocalCertificate(certificate); |
| 395 } | 396 } |
| 396 | 397 |
| 397 rtc::scoped_ptr<rtc::SSLCertificate> | 398 std::unique_ptr<rtc::SSLCertificate> |
| 398 TransportController::GetRemoteSSLCertificate_w( | 399 TransportController::GetRemoteSSLCertificate_w( |
| 399 const std::string& transport_name) { | 400 const std::string& transport_name) { |
| 400 RTC_DCHECK(worker_thread_->IsCurrent()); | 401 RTC_DCHECK(worker_thread_->IsCurrent()); |
| 401 | 402 |
| 402 Transport* t = GetTransport_w(transport_name); | 403 Transport* t = GetTransport_w(transport_name); |
| 403 if (!t) { | 404 if (!t) { |
| 404 return nullptr; | 405 return nullptr; |
| 405 } | 406 } |
| 406 | 407 |
| 407 return t->GetRemoteSSLCertificate(); | 408 return t->GetRemoteSSLCertificate(); |
| (...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 644 } | 645 } |
| 645 if (gathering_state_ != new_gathering_state) { | 646 if (gathering_state_ != new_gathering_state) { |
| 646 gathering_state_ = new_gathering_state; | 647 gathering_state_ = new_gathering_state; |
| 647 signaling_thread_->Post( | 648 signaling_thread_->Post( |
| 648 this, MSG_ICEGATHERINGSTATE, | 649 this, MSG_ICEGATHERINGSTATE, |
| 649 new rtc::TypedMessageData<IceGatheringState>(new_gathering_state)); | 650 new rtc::TypedMessageData<IceGatheringState>(new_gathering_state)); |
| 650 } | 651 } |
| 651 } | 652 } |
| 652 | 653 |
| 653 } // namespace cricket | 654 } // namespace cricket |
| OLD | NEW |