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

Unified Diff: webrtc/examples/peerconnection/client/conductor.cc

Issue 1972793003: Use scoped_refptr for On(Add|Remove)Stream and OnDataChannel. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Adding "deprecated" comments. Created 4 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « webrtc/examples/peerconnection/client/conductor.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/examples/peerconnection/client/conductor.cc
diff --git a/webrtc/examples/peerconnection/client/conductor.cc b/webrtc/examples/peerconnection/client/conductor.cc
index 8ec6ed9c1026fd34092041b5bea9d2ad87ac01b3..1b656512a0576bcb0d61f31710fa53ef81878c28 100644
--- a/webrtc/examples/peerconnection/client/conductor.cc
+++ b/webrtc/examples/peerconnection/client/conductor.cc
@@ -156,19 +156,16 @@ void Conductor::EnsureStreamingUI() {
//
// Called when a remote stream is added
-void Conductor::OnAddStream(webrtc::MediaStreamInterface* stream) {
+void Conductor::OnAddStream(
+ rtc::scoped_refptr<webrtc::MediaStreamInterface> stream) {
LOG(INFO) << __FUNCTION__ << " " << stream->label();
-
- stream->AddRef();
- main_wnd_->QueueUIThreadCallback(NEW_STREAM_ADDED,
- stream);
+ main_wnd_->QueueUIThreadCallback(NEW_STREAM_ADDED, stream.release());
tkchin_webrtc 2016/05/12 17:50:22 I haven't seen scoped_refptr used like this before
Taylor Brandstetter 2016/05/12 17:52:34 Yep; ".release()" is basically what you want to do
}
-void Conductor::OnRemoveStream(webrtc::MediaStreamInterface* stream) {
+void Conductor::OnRemoveStream(
+ rtc::scoped_refptr<webrtc::MediaStreamInterface> stream) {
LOG(INFO) << __FUNCTION__ << " " << stream->label();
- stream->AddRef();
- main_wnd_->QueueUIThreadCallback(STREAM_REMOVED,
- stream);
+ main_wnd_->QueueUIThreadCallback(STREAM_REMOVED, stream.release());
}
void Conductor::OnIceCandidate(const webrtc::IceCandidateInterface* candidate) {
« no previous file with comments | « webrtc/examples/peerconnection/client/conductor.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698