Index: content/renderer/renderer_webkitplatformsupport_impl.cc |
diff --git a/content/renderer/renderer_webkitplatformsupport_impl.cc b/content/renderer/renderer_webkitplatformsupport_impl.cc |
index 7e0f79603dbfe4fa535ee2c399189a0ebf55b4ad..a11952b0694e92fffaea105b7d3c966ff1b85abe 100644 |
--- a/content/renderer/renderer_webkitplatformsupport_impl.cc |
+++ b/content/renderer/renderer_webkitplatformsupport_impl.cc |
@@ -672,14 +672,31 @@ void RendererWebKitPlatformSupportImpl::GetPlugins( |
//------------------------------------------------------------------------------ |
-WebKit::WebPeerConnectionHandler* |
-RendererWebKitPlatformSupportImpl::createPeerConnectionHandler( |
- WebKit::WebPeerConnectionHandlerClient* client) { |
+namespace { |
+ |
+RenderViewImpl* findRenderView() { |
WebFrame* web_frame = WebFrame::frameForCurrentContext(); |
if (!web_frame) |
return NULL; |
- RenderViewImpl* render_view = RenderViewImpl::FromWebView(web_frame->view()); |
+ return RenderViewImpl::FromWebView(web_frame->view()); |
+} |
+ |
+} |
+ |
+WebKit::WebPeerConnectionHandler* |
+RendererWebKitPlatformSupportImpl::createPeerConnectionHandler( |
+ WebKit::WebPeerConnectionHandlerClient* client) { |
+ RenderViewImpl* render_view = findRenderView(); |
if (!render_view) |
return NULL; |
return render_view->CreatePeerConnectionHandler(client); |
} |
+ |
+WebKit::WebMediaStreamCenter* |
+RendererWebKitPlatformSupportImpl::createMediaStreamCenter( |
+ WebKit::WebMediaStreamCenterClient* client) { |
+ RenderViewImpl* render_view = findRenderView(); |
piman
2012/02/08 01:52:24
Is there any way we can avoid this? This is taking
tommyw
2012/02/08 13:14:18
Short answer: No
Longer answer: the MediaStreamCe
|
+ if (!render_view) |
+ return NULL; |
+ return render_view->CreateMediaStreamCenter(client); |
+} |