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

Side by Side Diff: talk/app/webrtc/objc/RTCPeerConnection.mm

Issue 1785353003: Replace scoped_ptr with unique_ptr in talk/ (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 4 years, 9 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
OLDNEW
1 /* 1 /*
2 * libjingle 2 * libjingle
3 * Copyright 2013 Google Inc. 3 * Copyright 2013 Google Inc.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are met: 6 * modification, are permitted provided that the following conditions are met:
7 * 7 *
8 * 1. Redistributions of source code must retain the above copyright notice, 8 * 1. Redistributions of source code must retain the above copyright notice,
9 * this list of conditions and the following disclaimer. 9 * this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright notice, 10 * 2. Redistributions in binary form must reproduce the above copyright notice,
(...skipping 27 matching lines...) Expand all
38 #import "RTCMediaConstraints+Internal.h" 38 #import "RTCMediaConstraints+Internal.h"
39 #import "RTCMediaStream+Internal.h" 39 #import "RTCMediaStream+Internal.h"
40 #import "RTCMediaStreamTrack+Internal.h" 40 #import "RTCMediaStreamTrack+Internal.h"
41 #import "RTCPeerConnectionObserver.h" 41 #import "RTCPeerConnectionObserver.h"
42 #import "RTCSessionDescription+Internal.h" 42 #import "RTCSessionDescription+Internal.h"
43 #import "RTCSessionDescription.h" 43 #import "RTCSessionDescription.h"
44 #import "RTCSessionDescriptionDelegate.h" 44 #import "RTCSessionDescriptionDelegate.h"
45 #import "RTCStatsDelegate.h" 45 #import "RTCStatsDelegate.h"
46 #import "RTCStatsReport+Internal.h" 46 #import "RTCStatsReport+Internal.h"
47 47
48 #include <memory>
49
48 #include "webrtc/api/jsep.h" 50 #include "webrtc/api/jsep.h"
49 51
50 NSString* const kRTCSessionDescriptionDelegateErrorDomain = @"RTCSDPError"; 52 NSString* const kRTCSessionDescriptionDelegateErrorDomain = @"RTCSDPError";
51 int const kRTCSessionDescriptionDelegateErrorCode = -1; 53 int const kRTCSessionDescriptionDelegateErrorCode = -1;
52 54
53 namespace webrtc { 55 namespace webrtc {
54 56
55 class RTCCreateSessionDescriptionObserver 57 class RTCCreateSessionDescriptionObserver
56 : public CreateSessionDescriptionObserver { 58 : public CreateSessionDescriptionObserver {
57 public: 59 public:
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
134 } 136 }
135 137
136 private: 138 private:
137 id<RTCStatsDelegate> _delegate; 139 id<RTCStatsDelegate> _delegate;
138 RTCPeerConnection* _peerConnection; 140 RTCPeerConnection* _peerConnection;
139 }; 141 };
140 } 142 }
141 143
142 @implementation RTCPeerConnection { 144 @implementation RTCPeerConnection {
143 NSMutableArray* _localStreams; 145 NSMutableArray* _localStreams;
144 rtc::scoped_ptr<webrtc::RTCPeerConnectionObserver> _observer; 146 std::unique_ptr<webrtc::RTCPeerConnectionObserver> _observer;
145 rtc::scoped_refptr<webrtc::PeerConnectionInterface> _peerConnection; 147 rtc::scoped_refptr<webrtc::PeerConnectionInterface> _peerConnection;
146 } 148 }
147 149
148 - (BOOL)addICECandidate:(RTCICECandidate*)candidate { 150 - (BOOL)addICECandidate:(RTCICECandidate*)candidate {
149 rtc::scoped_ptr<const webrtc::IceCandidateInterface> iceCandidate( 151 std::unique_ptr<const webrtc::IceCandidateInterface> iceCandidate(
150 candidate.candidate); 152 candidate.candidate);
151 return self.peerConnection->AddIceCandidate(iceCandidate.get()); 153 return self.peerConnection->AddIceCandidate(iceCandidate.get());
152 } 154 }
153 155
154 - (BOOL)addStream:(RTCMediaStream*)stream { 156 - (BOOL)addStream:(RTCMediaStream*)stream {
155 BOOL ret = self.peerConnection->AddStream(stream.mediaStream); 157 BOOL ret = self.peerConnection->AddStream(stream.mediaStream);
156 if (!ret) { 158 if (!ret) {
157 return NO; 159 return NO;
158 } 160 }
159 [_localStreams addObject:stream]; 161 [_localStreams addObject:stream];
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after
296 _delegate = delegate; 298 _delegate = delegate;
297 } 299 }
298 return self; 300 return self;
299 } 301 }
300 302
301 - (rtc::scoped_refptr<webrtc::PeerConnectionInterface>)peerConnection { 303 - (rtc::scoped_refptr<webrtc::PeerConnectionInterface>)peerConnection {
302 return _peerConnection; 304 return _peerConnection;
303 } 305 }
304 306
305 @end 307 @end
OLDNEW
« no previous file with comments | « talk/app/webrtc/objc/RTCOpenGLVideoRenderer.mm ('k') | talk/app/webrtc/objc/RTCPeerConnectionFactory.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698