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_thread_impl.h" | 5 #include "content/renderer/render_thread_impl.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <limits> | 8 #include <limits> |
9 #include <map> | 9 #include <map> |
10 #include <utility> | 10 #include <utility> |
(...skipping 630 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
641 new CacheStorageDispatcher(thread_safe_sender())); | 641 new CacheStorageDispatcher(thread_safe_sender())); |
642 | 642 |
643 // Note: This may reorder messages from the ResourceDispatcher with respect to | 643 // Note: This may reorder messages from the ResourceDispatcher with respect to |
644 // other subsystems. | 644 // other subsystems. |
645 resource_dispatch_throttler_.reset(new ResourceDispatchThrottler( | 645 resource_dispatch_throttler_.reset(new ResourceDispatchThrottler( |
646 static_cast<RenderThread*>(this), renderer_scheduler_.get(), | 646 static_cast<RenderThread*>(this), renderer_scheduler_.get(), |
647 base::TimeDelta::FromSecondsD(kThrottledResourceRequestFlushPeriodS), | 647 base::TimeDelta::FromSecondsD(kThrottledResourceRequestFlushPeriodS), |
648 kMaxResourceRequestsPerFlushWhenThrottled)); | 648 kMaxResourceRequestsPerFlushWhenThrottled)); |
649 resource_dispatcher()->set_message_sender(resource_dispatch_throttler_.get()); | 649 resource_dispatcher()->set_message_sender(resource_dispatch_throttler_.get()); |
650 | 650 |
| 651 media_stream_center_ = nullptr; |
| 652 |
651 blob_message_filter_ = new BlobMessageFilter(GetFileThreadTaskRunner()); | 653 blob_message_filter_ = new BlobMessageFilter(GetFileThreadTaskRunner()); |
652 AddFilter(blob_message_filter_.get()); | 654 AddFilter(blob_message_filter_.get()); |
653 db_message_filter_ = new DBMessageFilter(); | 655 db_message_filter_ = new DBMessageFilter(); |
654 AddFilter(db_message_filter_.get()); | 656 AddFilter(db_message_filter_.get()); |
655 | 657 |
656 vc_manager_.reset(new VideoCaptureImplManager()); | 658 vc_manager_.reset(new VideoCaptureImplManager()); |
657 | 659 |
658 browser_plugin_manager_.reset(new BrowserPluginManager()); | 660 browser_plugin_manager_.reset(new BrowserPluginManager()); |
659 AddObserver(browser_plugin_manager_.get()); | 661 AddObserver(browser_plugin_manager_.get()); |
660 | 662 |
(...skipping 1314 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1975 } | 1977 } |
1976 | 1978 |
1977 std::unique_ptr<cc::SwapPromise> | 1979 std::unique_ptr<cc::SwapPromise> |
1978 RenderThreadImpl::RequestCopyOfOutputForLayoutTest( | 1980 RenderThreadImpl::RequestCopyOfOutputForLayoutTest( |
1979 int32_t routing_id, | 1981 int32_t routing_id, |
1980 std::unique_ptr<cc::CopyOutputRequest> request) { | 1982 std::unique_ptr<cc::CopyOutputRequest> request) { |
1981 DCHECK(layout_test_deps_); | 1983 DCHECK(layout_test_deps_); |
1982 return layout_test_deps_->RequestCopyOfOutput(routing_id, std::move(request)); | 1984 return layout_test_deps_->RequestCopyOfOutput(routing_id, std::move(request)); |
1983 } | 1985 } |
1984 | 1986 |
1985 std::unique_ptr<blink::WebMediaStreamCenter> | 1987 blink::WebMediaStreamCenter* RenderThreadImpl::CreateMediaStreamCenter( |
1986 RenderThreadImpl::CreateMediaStreamCenter( | |
1987 blink::WebMediaStreamCenterClient* client) { | 1988 blink::WebMediaStreamCenterClient* client) { |
1988 std::unique_ptr<blink::WebMediaStreamCenter> media_stream_center; | |
1989 #if BUILDFLAG(ENABLE_WEBRTC) | 1989 #if BUILDFLAG(ENABLE_WEBRTC) |
1990 if (!media_stream_center) { | 1990 if (!media_stream_center_) { |
1991 media_stream_center = | 1991 media_stream_center_ = GetContentClient()->renderer() |
1992 GetContentClient()->renderer()->OverrideCreateWebMediaStreamCenter( | 1992 ->OverrideCreateWebMediaStreamCenter(client); |
1993 client); | 1993 if (!media_stream_center_) { |
1994 if (!media_stream_center) { | 1994 std::unique_ptr<MediaStreamCenter> media_stream_center( |
1995 media_stream_center = base::MakeUnique<MediaStreamCenter>( | 1995 new MediaStreamCenter(client, GetPeerConnectionDependencyFactory())); |
1996 client, GetPeerConnectionDependencyFactory()); | 1996 media_stream_center_ = media_stream_center.release(); |
1997 } | 1997 } |
1998 } | 1998 } |
1999 #endif | 1999 #endif |
2000 return media_stream_center; | 2000 return media_stream_center_; |
2001 } | 2001 } |
2002 | 2002 |
2003 #if BUILDFLAG(ENABLE_WEBRTC) | 2003 #if BUILDFLAG(ENABLE_WEBRTC) |
2004 PeerConnectionDependencyFactory* | 2004 PeerConnectionDependencyFactory* |
2005 RenderThreadImpl::GetPeerConnectionDependencyFactory() { | 2005 RenderThreadImpl::GetPeerConnectionDependencyFactory() { |
2006 return peer_connection_factory_.get(); | 2006 return peer_connection_factory_.get(); |
2007 } | 2007 } |
2008 #endif | 2008 #endif |
2009 | 2009 |
2010 mojom::RenderFrameMessageFilter* | 2010 mojom::RenderFrameMessageFilter* |
(...skipping 403 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2414 } | 2414 } |
2415 } | 2415 } |
2416 | 2416 |
2417 void RenderThreadImpl::OnRendererInterfaceRequest( | 2417 void RenderThreadImpl::OnRendererInterfaceRequest( |
2418 mojom::RendererAssociatedRequest request) { | 2418 mojom::RendererAssociatedRequest request) { |
2419 DCHECK(!renderer_binding_.is_bound()); | 2419 DCHECK(!renderer_binding_.is_bound()); |
2420 renderer_binding_.Bind(std::move(request)); | 2420 renderer_binding_.Bind(std::move(request)); |
2421 } | 2421 } |
2422 | 2422 |
2423 } // namespace content | 2423 } // namespace content |
OLD | NEW |