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

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

Issue 16431010: Refactor RenderProcessHost to use IPC::Listener instead of RenderWidgetHost (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixing Windows compile error. 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
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 855 matching lines...) Expand 10 before | Expand all | Expand 10 after
866 } 866 }
867 867
868 RenderWidgetHost* CaptureMachine::GetTarget() { 868 RenderWidgetHost* CaptureMachine::GetTarget() {
869 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 869 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
870 if (!web_contents()) 870 if (!web_contents())
871 return NULL; 871 return NULL;
872 872
873 RenderWidgetHost* rwh = NULL; 873 RenderWidgetHost* rwh = NULL;
874 if (fullscreen_widget_id_ != MSG_ROUTING_NONE) { 874 if (fullscreen_widget_id_ != MSG_ROUTING_NONE) {
875 RenderProcessHost* process = web_contents()->GetRenderProcessHost(); 875 RenderProcessHost* process = web_contents()->GetRenderProcessHost();
876 rwh = process ? process->GetRenderWidgetHostByID(fullscreen_widget_id_) 876 if (process) {
877 : NULL; 877 rwh = RenderWidgetHost::FromID(process->GetID(), fullscreen_widget_id_);
878 } else {
879 rwh = NULL;
jam 2013/06/12 19:59:59 nit: skip the else, it's not needed since rwh is i
nasko 2013/06/12 21:18:59 Done.
880 }
878 } else { 881 } else {
879 rwh = web_contents()->GetRenderViewHost(); 882 rwh = web_contents()->GetRenderViewHost();
880 } 883 }
881 884
882 return rwh; 885 return rwh;
883 } 886 }
884 887
885 void CaptureMachine::DidCopyFromBackingStore( 888 void CaptureMachine::DidCopyFromBackingStore(
886 const base::Time& start_time, 889 const base::Time& start_time,
887 const scoped_refptr<media::VideoFrame>& target, 890 const scoped_refptr<media::VideoFrame>& target,
(...skipping 376 matching lines...) Expand 10 before | Expand all | Expand 10 after
1264 void WebContentsVideoCaptureDevice::DeAllocate() { 1267 void WebContentsVideoCaptureDevice::DeAllocate() {
1265 impl_->DeAllocate(); 1268 impl_->DeAllocate();
1266 } 1269 }
1267 1270
1268 const media::VideoCaptureDevice::Name& 1271 const media::VideoCaptureDevice::Name&
1269 WebContentsVideoCaptureDevice::device_name() { 1272 WebContentsVideoCaptureDevice::device_name() {
1270 return device_name_; 1273 return device_name_;
1271 } 1274 }
1272 1275
1273 } // namespace content 1276 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698