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 1306 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1967 } | 1969 } |
1968 | 1970 |
1969 std::unique_ptr<cc::SwapPromise> | 1971 std::unique_ptr<cc::SwapPromise> |
1970 RenderThreadImpl::RequestCopyOfOutputForLayoutTest( | 1972 RenderThreadImpl::RequestCopyOfOutputForLayoutTest( |
1971 int32_t routing_id, | 1973 int32_t routing_id, |
1972 std::unique_ptr<cc::CopyOutputRequest> request) { | 1974 std::unique_ptr<cc::CopyOutputRequest> request) { |
1973 DCHECK(layout_test_deps_); | 1975 DCHECK(layout_test_deps_); |
1974 return layout_test_deps_->RequestCopyOfOutput(routing_id, std::move(request)); | 1976 return layout_test_deps_->RequestCopyOfOutput(routing_id, std::move(request)); |
1975 } | 1977 } |
1976 | 1978 |
1977 std::unique_ptr<blink::WebMediaStreamCenter> | 1979 blink::WebMediaStreamCenter* RenderThreadImpl::CreateMediaStreamCenter( |
1978 RenderThreadImpl::CreateMediaStreamCenter( | |
1979 blink::WebMediaStreamCenterClient* client) { | 1980 blink::WebMediaStreamCenterClient* client) { |
1980 std::unique_ptr<blink::WebMediaStreamCenter> media_stream_center; | |
1981 #if BUILDFLAG(ENABLE_WEBRTC) | 1981 #if BUILDFLAG(ENABLE_WEBRTC) |
1982 if (!media_stream_center) { | 1982 if (!media_stream_center_) { |
1983 media_stream_center = | 1983 media_stream_center_ = GetContentClient()->renderer() |
1984 GetContentClient()->renderer()->OverrideCreateWebMediaStreamCenter( | 1984 ->OverrideCreateWebMediaStreamCenter(client); |
1985 client); | 1985 if (!media_stream_center_) { |
1986 if (!media_stream_center) { | 1986 std::unique_ptr<MediaStreamCenter> media_stream_center( |
1987 media_stream_center = base::MakeUnique<MediaStreamCenter>( | 1987 new MediaStreamCenter(client, GetPeerConnectionDependencyFactory())); |
1988 client, GetPeerConnectionDependencyFactory()); | 1988 media_stream_center_ = media_stream_center.release(); |
1989 } | 1989 } |
1990 } | 1990 } |
1991 #endif | 1991 #endif |
1992 return media_stream_center; | 1992 return media_stream_center_; |
1993 } | 1993 } |
1994 | 1994 |
1995 #if BUILDFLAG(ENABLE_WEBRTC) | 1995 #if BUILDFLAG(ENABLE_WEBRTC) |
1996 PeerConnectionDependencyFactory* | 1996 PeerConnectionDependencyFactory* |
1997 RenderThreadImpl::GetPeerConnectionDependencyFactory() { | 1997 RenderThreadImpl::GetPeerConnectionDependencyFactory() { |
1998 return peer_connection_factory_.get(); | 1998 return peer_connection_factory_.get(); |
1999 } | 1999 } |
2000 #endif | 2000 #endif |
2001 | 2001 |
2002 mojom::RenderFrameMessageFilter* | 2002 mojom::RenderFrameMessageFilter* |
(...skipping 403 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2406 } | 2406 } |
2407 } | 2407 } |
2408 | 2408 |
2409 void RenderThreadImpl::OnRendererInterfaceRequest( | 2409 void RenderThreadImpl::OnRendererInterfaceRequest( |
2410 mojom::RendererAssociatedRequest request) { | 2410 mojom::RendererAssociatedRequest request) { |
2411 DCHECK(!renderer_binding_.is_bound()); | 2411 DCHECK(!renderer_binding_.is_bound()); |
2412 renderer_binding_.Bind(std::move(request)); | 2412 renderer_binding_.Bind(std::move(request)); |
2413 } | 2413 } |
2414 | 2414 |
2415 } // namespace content | 2415 } // namespace content |
OLD | NEW |