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/render_view_impl.h" | 5 #include "content/renderer/render_view_impl.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <cmath> | 8 #include <cmath> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 821 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
832 session_storage_namespace_id, | 832 session_storage_namespace_id, |
833 frame_name, | 833 frame_name, |
834 is_renderer_created, | 834 is_renderer_created, |
835 swapped_out, | 835 swapped_out, |
836 next_page_id, | 836 next_page_id, |
837 screen_info, | 837 screen_info, |
838 guest_to_embedder_channel, | 838 guest_to_embedder_channel, |
839 accessibility_mode); | 839 accessibility_mode); |
840 } | 840 } |
841 | 841 |
842 WebPeerConnection00Handler* RenderViewImpl::CreatePeerConnectionHandlerJsep( | |
843 WebPeerConnection00HandlerClient* client) { | |
844 EnsureMediaStreamImpl(); | |
845 if (!media_stream_impl_) | |
846 return NULL; | |
847 return media_stream_impl_->CreatePeerConnectionHandlerJsep(client); | |
848 } | |
849 | |
850 void RenderViewImpl::AddObserver(RenderViewObserver* observer) { | 842 void RenderViewImpl::AddObserver(RenderViewObserver* observer) { |
851 observers_.AddObserver(observer); | 843 observers_.AddObserver(observer); |
852 } | 844 } |
853 | 845 |
854 void RenderViewImpl::RemoveObserver(RenderViewObserver* observer) { | 846 void RenderViewImpl::RemoveObserver(RenderViewObserver* observer) { |
855 observer->RenderViewGone(); | 847 observer->RenderViewGone(); |
856 observers_.RemoveObserver(observer); | 848 observers_.RemoveObserver(observer); |
857 } | 849 } |
858 | 850 |
859 WebKit::WebView* RenderViewImpl::webview() const { | 851 WebKit::WebView* RenderViewImpl::webview() const { |
(...skipping 2969 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3829 | 3821 |
3830 void RenderViewImpl::EnsureMediaStreamImpl() { | 3822 void RenderViewImpl::EnsureMediaStreamImpl() { |
3831 if (!RenderThreadImpl::current()) // Will be NULL during unit tests. | 3823 if (!RenderThreadImpl::current()) // Will be NULL during unit tests. |
3832 return; | 3824 return; |
3833 | 3825 |
3834 #if defined(ENABLE_WEBRTC) | 3826 #if defined(ENABLE_WEBRTC) |
3835 if (!media_stream_dispatcher_) | 3827 if (!media_stream_dispatcher_) |
3836 media_stream_dispatcher_ = new MediaStreamDispatcher(this); | 3828 media_stream_dispatcher_ = new MediaStreamDispatcher(this); |
3837 | 3829 |
3838 if (!media_stream_impl_) { | 3830 if (!media_stream_impl_) { |
3839 MediaStreamDependencyFactory* factory = new MediaStreamDependencyFactory( | |
3840 RenderThreadImpl::current()->video_capture_impl_manager()); | |
3841 media_stream_impl_ = new MediaStreamImpl( | 3831 media_stream_impl_ = new MediaStreamImpl( |
3842 this, | 3832 this, |
3843 media_stream_dispatcher_, | 3833 media_stream_dispatcher_, |
3844 RenderThreadImpl::current()->p2p_socket_dispatcher(), | |
3845 RenderThreadImpl::current()->video_capture_impl_manager(), | 3834 RenderThreadImpl::current()->video_capture_impl_manager(), |
3846 factory); | 3835 RenderThreadImpl::current()->GetMediaStreamDependencyFactory()); |
3847 } | 3836 } |
3848 #endif | 3837 #endif |
3849 } | 3838 } |
3850 | 3839 |
3851 void RenderViewImpl::didChangeContentsSize(WebFrame* frame, | 3840 void RenderViewImpl::didChangeContentsSize(WebFrame* frame, |
3852 const WebSize& size) { | 3841 const WebSize& size) { |
3853 if (webview()->mainFrame() != frame) | 3842 if (webview()->mainFrame() != frame) |
3854 return; | 3843 return; |
3855 WebView* frameView = frame->view(); | 3844 WebView* frameView = frame->view(); |
3856 if (!frameView) | 3845 if (!frameView) |
(...skipping 2302 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6159 | 6148 |
6160 updating_frame_tree_ = true; | 6149 updating_frame_tree_ = true; |
6161 active_frame_id_map_.clear(); | 6150 active_frame_id_map_.clear(); |
6162 | 6151 |
6163 target_process_id_ = process_id; | 6152 target_process_id_ = process_id; |
6164 target_routing_id_ = route_id; | 6153 target_routing_id_ = route_id; |
6165 CreateFrameTree(webview()->mainFrame(), frames); | 6154 CreateFrameTree(webview()->mainFrame(), frames); |
6166 | 6155 |
6167 updating_frame_tree_ = false; | 6156 updating_frame_tree_ = false; |
6168 } | 6157 } |
OLD | NEW |