Chromium Code Reviews| Index: webrtc/sdk/objc/Framework/Classes/RTCPeerConnection.mm |
| diff --git a/webrtc/sdk/objc/Framework/Classes/RTCPeerConnection.mm b/webrtc/sdk/objc/Framework/Classes/RTCPeerConnection.mm |
| index b4a873847de5bda226a1c72d23a48b7eff97f1bb..de7608c3b9941dd1acffc6b8e8dc0d5c52211379 100644 |
| --- a/webrtc/sdk/objc/Framework/Classes/RTCPeerConnection.mm |
| +++ b/webrtc/sdk/objc/Framework/Classes/RTCPeerConnection.mm |
| @@ -207,6 +207,7 @@ void PeerConnectionDelegateAdapter::OnIceCandidatesRemoved( |
| NSMutableArray<RTCMediaStream *> *_localStreams; |
| std::unique_ptr<webrtc::PeerConnectionDelegateAdapter> _observer; |
| rtc::scoped_refptr<webrtc::PeerConnectionInterface> _peerConnection; |
| + std::unique_ptr<webrtc::MediaConstraints> _nativeConstraints; |
|
tkchin_webrtc
2017/01/09 21:56:36
Is this safe? Does peerconnection take ownership o
Taylor Brandstetter
2017/01/09 22:03:45
Yes, it's safe, and n,o nothing else takes ownersh
tkchin_webrtc
2017/01/09 22:35:30
Ah, so it is. Thanks.
|
| BOOL _hasStartedRtcEventLog; |
| } |
| @@ -224,11 +225,11 @@ void PeerConnectionDelegateAdapter::OnIceCandidatesRemoved( |
| } |
| if (self = [super init]) { |
| _observer.reset(new webrtc::PeerConnectionDelegateAdapter(self)); |
| - std::unique_ptr<webrtc::MediaConstraints> nativeConstraints = |
| - constraints.nativeConstraints; |
| + _nativeConstraints = constraints.nativeConstraints; |
| + CopyConstraintsIntoRtcConfiguration(_nativeConstraints.get(), |
| + config.get()); |
| _peerConnection = |
| factory.nativeFactory->CreatePeerConnection(*config, |
| - nativeConstraints.get(), |
| nullptr, |
| nullptr, |
| _observer.get()); |
| @@ -282,6 +283,8 @@ void PeerConnectionDelegateAdapter::OnIceCandidatesRemoved( |
| if (!config) { |
| return NO; |
| } |
| + CopyConstraintsIntoRtcConfiguration(_nativeConstraints.get(), |
| + config.get()); |
| return _peerConnection->SetConfiguration(*config); |
| } |