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

Side by Side Diff: content/renderer/media/media_stream_dependency_factory.cc

Issue 11458003: Remove scoped_refptr::release which is confusing and causes leaks. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: duh Created 8 years 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/renderer/media/media_stream_dependency_factory.h" 5 #include "content/renderer/media/media_stream_dependency_factory.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/synchronization/waitable_event.h" 9 #include "base/synchronization/waitable_event.h"
10 #include "base/utf_string_conversions.h" 10 #include "base/utf_string_conversions.h"
(...skipping 285 matching lines...) Expand 10 before | Expand all | Expand 10 after
296 296
297 bool MediaStreamDependencyFactory::CreatePeerConnectionFactory() { 297 bool MediaStreamDependencyFactory::CreatePeerConnectionFactory() {
298 if (!pc_factory_.get()) { 298 if (!pc_factory_.get()) {
299 DCHECK(!audio_device_); 299 DCHECK(!audio_device_);
300 audio_device_ = new WebRtcAudioDeviceImpl(); 300 audio_device_ = new WebRtcAudioDeviceImpl();
301 scoped_refptr<webrtc::PeerConnectionFactoryInterface> factory( 301 scoped_refptr<webrtc::PeerConnectionFactoryInterface> factory(
302 webrtc::CreatePeerConnectionFactory(worker_thread_, 302 webrtc::CreatePeerConnectionFactory(worker_thread_,
303 signaling_thread_, 303 signaling_thread_,
304 audio_device_)); 304 audio_device_));
305 if (factory.get()) 305 if (factory.get())
306 pc_factory_ = factory.release(); 306 pc_factory_ = factory;
307 else 307 else
308 audio_device_ = NULL; 308 audio_device_ = NULL;
309 } 309 }
310 return pc_factory_.get() != NULL; 310 return pc_factory_.get() != NULL;
311 } 311 }
312 312
313 bool MediaStreamDependencyFactory::PeerConnectionFactoryCreated() { 313 bool MediaStreamDependencyFactory::PeerConnectionFactoryCreated() {
314 return pc_factory_.get() != NULL; 314 return pc_factory_.get() != NULL;
315 } 315 }
316 316
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after
484 // processed before returning. We wait for the above task to finish before 484 // processed before returning. We wait for the above task to finish before
485 // letting the the function continue to avoid any potential race issues. 485 // letting the the function continue to avoid any potential race issues.
486 chrome_worker_thread_.Stop(); 486 chrome_worker_thread_.Stop();
487 } else { 487 } else {
488 NOTREACHED() << "Worker thread not running."; 488 NOTREACHED() << "Worker thread not running.";
489 } 489 }
490 } 490 }
491 } 491 }
492 492
493 } // namespace content 493 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698