Use static_cast to get webrtc::Peerconnection in common workaround.

Bug: None
Change-Id: I523a22cfe69757e38922634d6054dca2d3bedb1a
No-Try: True
Reviewed-on: https://webrtc-review.googlesource.com/32640
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#21239}
This commit is contained in:
Mirko Bonadei
2017-12-13 11:29:34 +01:00
committed by Commit Bot
parent 1aa285974b
commit e97de91d39
4 changed files with 16 additions and 14 deletions

View File

@ -92,9 +92,10 @@ class PeerConnectionWrapperForBundleTest : public PeerConnectionWrapper {
} }
PeerConnection* GetInternalPeerConnection() { PeerConnection* GetInternalPeerConnection() {
auto* pci = reinterpret_cast< auto* pci =
PeerConnectionProxyWithInternal<PeerConnectionInterface>*>(pc()); static_cast<PeerConnectionProxyWithInternal<PeerConnectionInterface>*>(
return reinterpret_cast<PeerConnection*>(pci->internal()); pc());
return static_cast<PeerConnection*>(pci->internal());
} }
// Returns true if the stats indicate that an ICE connection is either in // Returns true if the stats indicate that an ICE connection is either in

View File

@ -74,9 +74,10 @@ class PeerConnectionWrapperForDataChannelTest : public PeerConnectionWrapper {
} }
PeerConnection* GetInternalPeerConnection() { PeerConnection* GetInternalPeerConnection() {
auto* pci = reinterpret_cast< auto* pci =
PeerConnectionProxyWithInternal<PeerConnectionInterface>*>(pc()); static_cast<PeerConnectionProxyWithInternal<PeerConnectionInterface>*>(
return reinterpret_cast<PeerConnection*>(pci->internal()); pc());
return static_cast<PeerConnection*>(pci->internal());
} }
private: private:

View File

@ -187,11 +187,10 @@ class PeerConnectionIceUnitTest : public ::testing::Test {
// TODO(qingsi): Rewrite this method in terms of the standard IceTransport // TODO(qingsi): Rewrite this method in terms of the standard IceTransport
// after it is implemented. // after it is implemented.
cricket::IceRole GetIceRole(const WrapperPtr& pc_wrapper_ptr) { cricket::IceRole GetIceRole(const WrapperPtr& pc_wrapper_ptr) {
auto* pc_proxy = reinterpret_cast< auto* pc_proxy =
PeerConnectionProxyWithInternal<PeerConnectionInterface>*>( static_cast<PeerConnectionProxyWithInternal<PeerConnectionInterface>*>(
pc_wrapper_ptr->pc()); pc_wrapper_ptr->pc());
PeerConnection* pc = PeerConnection* pc = static_cast<PeerConnection*>(pc_proxy->internal());
reinterpret_cast<PeerConnection*>(pc_proxy->internal());
return pc->voice_channel() return pc->voice_channel()
->rtp_dtls_transport() ->rtp_dtls_transport()
->ice_transport() ->ice_transport()

View File

@ -48,9 +48,10 @@ class PeerConnectionWrapperForSignalingTest : public PeerConnectionWrapper {
} }
PeerConnection* GetInternalPeerConnection() { PeerConnection* GetInternalPeerConnection() {
auto* pci = reinterpret_cast< auto* pci =
PeerConnectionProxyWithInternal<PeerConnectionInterface>*>(pc()); static_cast<PeerConnectionProxyWithInternal<PeerConnectionInterface>*>(
return reinterpret_cast<PeerConnection*>(pci->internal()); pc());
return static_cast<PeerConnection*>(pci->internal());
} }
}; };