OLD | NEW |
---|---|
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/renderer_webkitplatformsupport_impl.h" | 5 #include "content/renderer/renderer_webkitplatformsupport_impl.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/file_path.h" | 8 #include "base/file_path.h" |
9 #include "base/file_util.h" | 9 #include "base/file_util.h" |
10 #include "base/platform_file.h" | 10 #include "base/platform_file.h" |
(...skipping 654 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
665 void RendererWebKitPlatformSupportImpl::GetPlugins( | 665 void RendererWebKitPlatformSupportImpl::GetPlugins( |
666 bool refresh, std::vector<webkit::WebPluginInfo>* plugins) { | 666 bool refresh, std::vector<webkit::WebPluginInfo>* plugins) { |
667 if (!RenderThreadImpl::current()->plugin_refresh_allowed()) | 667 if (!RenderThreadImpl::current()->plugin_refresh_allowed()) |
668 refresh = false; | 668 refresh = false; |
669 RenderThreadImpl::current()->Send( | 669 RenderThreadImpl::current()->Send( |
670 new ViewHostMsg_GetPlugins(refresh, plugins)); | 670 new ViewHostMsg_GetPlugins(refresh, plugins)); |
671 } | 671 } |
672 | 672 |
673 //------------------------------------------------------------------------------ | 673 //------------------------------------------------------------------------------ |
674 | 674 |
675 namespace { | |
676 | |
677 RenderViewImpl* findRenderView() { | |
678 WebFrame* web_frame = WebFrame::frameForCurrentContext(); | |
679 if (!web_frame) | |
680 return NULL; | |
681 return RenderViewImpl::FromWebView(web_frame->view()); | |
682 } | |
683 | |
684 } | |
685 | |
675 WebKit::WebPeerConnectionHandler* | 686 WebKit::WebPeerConnectionHandler* |
676 RendererWebKitPlatformSupportImpl::createPeerConnectionHandler( | 687 RendererWebKitPlatformSupportImpl::createPeerConnectionHandler( |
677 WebKit::WebPeerConnectionHandlerClient* client) { | 688 WebKit::WebPeerConnectionHandlerClient* client) { |
678 WebFrame* web_frame = WebFrame::frameForCurrentContext(); | 689 RenderViewImpl* render_view = findRenderView(); |
679 if (!web_frame) | |
680 return NULL; | |
681 RenderViewImpl* render_view = RenderViewImpl::FromWebView(web_frame->view()); | |
682 if (!render_view) | 690 if (!render_view) |
683 return NULL; | 691 return NULL; |
684 return render_view->CreatePeerConnectionHandler(client); | 692 return render_view->CreatePeerConnectionHandler(client); |
685 } | 693 } |
694 | |
695 WebKit::WebMediaStreamCenter* | |
696 RendererWebKitPlatformSupportImpl::createMediaStreamCenter( | |
697 WebKit::WebMediaStreamCenterClient* client) { | |
698 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
| |
699 if (!render_view) | |
700 return NULL; | |
701 return render_view->CreateMediaStreamCenter(client); | |
702 } | |
OLD | NEW |