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

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

Issue 843943002: Refactor VideoCapturerDelegate to use WeakPtr instead of refcount. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix source_formats_callback_.reset Created 5 years, 11 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
« no previous file with comments | « content/renderer/media/media_stream_video_capturer_source.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/user_media_client_impl.h" 5 #include "content/renderer/media/user_media_client_impl.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/hash.h" 9 #include "base/hash.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 565 matching lines...) Expand 10 before | Expand all | Expand 10 after
576 } 576 }
577 local_sources_.push_back(*webkit_source); 577 local_sources_.push_back(*webkit_source);
578 } 578 }
579 579
580 MediaStreamVideoSource* UserMediaClientImpl::CreateVideoSource( 580 MediaStreamVideoSource* UserMediaClientImpl::CreateVideoSource(
581 const StreamDeviceInfo& device, 581 const StreamDeviceInfo& device,
582 const MediaStreamSource::SourceStoppedCallback& stop_callback) { 582 const MediaStreamSource::SourceStoppedCallback& stop_callback) {
583 return new content::MediaStreamVideoCapturerSource( 583 return new content::MediaStreamVideoCapturerSource(
584 device, 584 device,
585 stop_callback, 585 stop_callback,
586 new VideoCapturerDelegate(device)); 586 scoped_ptr<VideoCapturerDelegate>(new VideoCapturerDelegate(device)));
587 } 587 }
588 588
589 void UserMediaClientImpl::CreateVideoTracks( 589 void UserMediaClientImpl::CreateVideoTracks(
590 const StreamDeviceInfoArray& devices, 590 const StreamDeviceInfoArray& devices,
591 const blink::WebMediaConstraints& constraints, 591 const blink::WebMediaConstraints& constraints,
592 blink::WebVector<blink::WebMediaStreamTrack>* webkit_tracks, 592 blink::WebVector<blink::WebMediaStreamTrack>* webkit_tracks,
593 UserMediaRequestInfo* request) { 593 UserMediaRequestInfo* request) {
594 DCHECK_EQ(devices.size(), webkit_tracks->size()); 594 DCHECK_EQ(devices.size(), webkit_tracks->size());
595 595
596 for (size_t i = 0; i < devices.size(); ++i) { 596 for (size_t i = 0; i < devices.size(); ++i) {
(...skipping 465 matching lines...) Expand 10 before | Expand all | Expand 10 after
1062 return; 1062 return;
1063 } 1063 }
1064 } 1064 }
1065 } 1065 }
1066 1066
1067 bool UserMediaClientImpl::UserMediaRequestInfo::HasPendingSources() const { 1067 bool UserMediaClientImpl::UserMediaRequestInfo::HasPendingSources() const {
1068 return !sources_waiting_for_callback_.empty(); 1068 return !sources_waiting_for_callback_.empty();
1069 } 1069 }
1070 1070
1071 } // namespace content 1071 } // namespace content
OLDNEW
« no previous file with comments | « content/renderer/media/media_stream_video_capturer_source.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698