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

Side by Side Diff: content/browser/renderer_host/media/web_contents_video_capture_device.cc

Issue 16256018: Update content/ to use WeakPtr<T>::get() instead of implicit "operator T*" (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix incorrectly modified code Created 7 years, 6 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 | Annotate | Revision Log
« no previous file with comments | « content/browser/plugin_loader_posix.cc ('k') | content/browser/ssl/ssl_error_handler.cc » ('j') | 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 // Implementation notes: This needs to work on a variety of hardware 5 // Implementation notes: This needs to work on a variety of hardware
6 // configurations where the speed of the CPU and GPU greatly affect overall 6 // configurations where the speed of the CPU and GPU greatly affect overall
7 // performance. Spanning several threads, the process of capturing has been 7 // performance. Spanning several threads, the process of capturing has been
8 // split up into four conceptual stages: 8 // split up into four conceptual stages:
9 // 9 //
10 // 1. Reserve Buffer: Before a frame can be captured, a slot in the consumer's 10 // 1. Reserve Buffer: Before a frame can be captured, a slot in the consumer's
(...skipping 1105 matching lines...) Expand 10 before | Expand all | Expand 10 after
1116 1116
1117 TransitionStateTo(kCapturing); 1117 TransitionStateTo(kCapturing);
1118 1118
1119 oracle_proxy_->Start(); 1119 oracle_proxy_->Start();
1120 } 1120 }
1121 1121
1122 // static 1122 // static
1123 void WebContentsVideoCaptureDevice::Impl::AssignCaptureMachine( 1123 void WebContentsVideoCaptureDevice::Impl::AssignCaptureMachine(
1124 base::WeakPtr<WebContentsVideoCaptureDevice::Impl> impl, 1124 base::WeakPtr<WebContentsVideoCaptureDevice::Impl> impl,
1125 scoped_ptr<CaptureMachine> capture_machine) { 1125 scoped_ptr<CaptureMachine> capture_machine) {
1126 DCHECK(!impl || impl->thread_checker_.CalledOnValidThread()); 1126 DCHECK(!impl.get() || impl->thread_checker_.CalledOnValidThread());
1127 1127
1128 if (!impl) { 1128 if (!impl.get()) {
1129 // If WCVD::Impl was destroyed before we got back on it's thread and 1129 // If WCVD::Impl was destroyed before we got back on it's thread and
1130 // capture_machine is not NULL, then we need to return to the UI thread to 1130 // capture_machine is not NULL, then we need to return to the UI thread to
1131 // safely cleanup the CaptureMachine. 1131 // safely cleanup the CaptureMachine.
1132 if (capture_machine) { 1132 if (capture_machine) {
1133 BrowserThread::PostTask( 1133 BrowserThread::PostTask(
1134 BrowserThread::UI, FROM_HERE, base::Bind( 1134 BrowserThread::UI, FROM_HERE, base::Bind(
1135 &DeleteCaptureMachineOnUIThread, base::Passed(&capture_machine))); 1135 &DeleteCaptureMachineOnUIThread, base::Passed(&capture_machine)));
1136 return; 1136 return;
1137 } 1137 }
1138 } else if (!capture_machine) { 1138 } else if (!capture_machine) {
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after
1264 void WebContentsVideoCaptureDevice::DeAllocate() { 1264 void WebContentsVideoCaptureDevice::DeAllocate() {
1265 impl_->DeAllocate(); 1265 impl_->DeAllocate();
1266 } 1266 }
1267 1267
1268 const media::VideoCaptureDevice::Name& 1268 const media::VideoCaptureDevice::Name&
1269 WebContentsVideoCaptureDevice::device_name() { 1269 WebContentsVideoCaptureDevice::device_name() {
1270 return device_name_; 1270 return device_name_;
1271 } 1271 }
1272 1272
1273 } // namespace content 1273 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/plugin_loader_posix.cc ('k') | content/browser/ssl/ssl_error_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698