OLD | NEW |
---|---|
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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 // Represents the browser side of the browser <--> renderer communication | 5 // Represents the browser side of the browser <--> renderer communication |
6 // channel. There will be one RenderProcessHost per renderer process. | 6 // channel. There will be one RenderProcessHost per renderer process. |
7 | 7 |
8 #include "content/browser/renderer_host/render_process_host_impl.h" | 8 #include "content/browser/renderer_host/render_process_host_impl.h" |
9 | 9 |
10 #include <algorithm> | 10 #include <algorithm> |
(...skipping 854 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
865 | 865 |
866 scoped_refptr<net::URLRequestContextGetter> request_context( | 866 scoped_refptr<net::URLRequestContextGetter> request_context( |
867 browser_context->GetRequestContextForRenderProcess(GetID())); | 867 browser_context->GetRequestContextForRenderProcess(GetID())); |
868 scoped_refptr<net::URLRequestContextGetter> media_request_context( | 868 scoped_refptr<net::URLRequestContextGetter> media_request_context( |
869 browser_context->GetMediaRequestContextForRenderProcess(GetID())); | 869 browser_context->GetMediaRequestContextForRenderProcess(GetID())); |
870 | 870 |
871 ResourceMessageFilter::GetContextsCallback get_contexts_callback( | 871 ResourceMessageFilter::GetContextsCallback get_contexts_callback( |
872 base::Bind(&GetContexts, browser_context->GetResourceContext(), | 872 base::Bind(&GetContexts, browser_context->GetResourceContext(), |
873 request_context, media_request_context)); | 873 request_context, media_request_context)); |
874 | 874 |
875 // Several filters need the Blob storage context, so fetch it in advance. | |
876 ChromeBlobStorageContext* chrome_blob_storage_context = | |
kinuko
2016/02/05 05:18:06
nit: this class name is very unfortunate (should b
Adam Rice
2016/02/05 07:21:48
I have been trying to think of a better name for C
| |
877 ChromeBlobStorageContext::GetFor(browser_context); | |
878 | |
875 ResourceMessageFilter* resource_message_filter = new ResourceMessageFilter( | 879 ResourceMessageFilter* resource_message_filter = new ResourceMessageFilter( |
876 GetID(), PROCESS_TYPE_RENDERER, | 880 GetID(), PROCESS_TYPE_RENDERER, |
877 storage_partition_impl_->GetAppCacheService(), | 881 storage_partition_impl_->GetAppCacheService(), |
878 ChromeBlobStorageContext::GetFor(browser_context), | 882 chrome_blob_storage_context, |
879 storage_partition_impl_->GetFileSystemContext(), | 883 storage_partition_impl_->GetFileSystemContext(), |
880 storage_partition_impl_->GetServiceWorkerContext(), | 884 storage_partition_impl_->GetServiceWorkerContext(), |
881 storage_partition_impl_->GetHostZoomLevelContext(), | 885 storage_partition_impl_->GetHostZoomLevelContext(), |
882 get_contexts_callback); | 886 get_contexts_callback); |
883 | 887 |
884 AddFilter(resource_message_filter); | 888 AddFilter(resource_message_filter); |
885 MediaStreamManager* media_stream_manager = | 889 MediaStreamManager* media_stream_manager = |
886 BrowserMainLoop::GetInstance()->media_stream_manager(); | 890 BrowserMainLoop::GetInstance()->media_stream_manager(); |
887 // The AudioInputRendererHost and AudioRendererHost needs to be available for | 891 // The AudioInputRendererHost and AudioRendererHost needs to be available for |
888 // lookup, so it's stashed in a member variable. | 892 // lookup, so it's stashed in a member variable. |
(...skipping 11 matching lines...) Expand all Loading... | |
900 new MidiHost(GetID(), BrowserMainLoop::GetInstance()->midi_manager())); | 904 new MidiHost(GetID(), BrowserMainLoop::GetInstance()->midi_manager())); |
901 AddFilter(new VideoCaptureHost(media_stream_manager)); | 905 AddFilter(new VideoCaptureHost(media_stream_manager)); |
902 AddFilter(new AppCacheDispatcherHost( | 906 AddFilter(new AppCacheDispatcherHost( |
903 storage_partition_impl_->GetAppCacheService(), GetID())); | 907 storage_partition_impl_->GetAppCacheService(), GetID())); |
904 AddFilter(new ClipboardMessageFilter); | 908 AddFilter(new ClipboardMessageFilter); |
905 AddFilter(new DOMStorageMessageFilter( | 909 AddFilter(new DOMStorageMessageFilter( |
906 storage_partition_impl_->GetDOMStorageContext())); | 910 storage_partition_impl_->GetDOMStorageContext())); |
907 AddFilter(new IndexedDBDispatcherHost( | 911 AddFilter(new IndexedDBDispatcherHost( |
908 GetID(), storage_partition_impl_->GetURLRequestContext(), | 912 GetID(), storage_partition_impl_->GetURLRequestContext(), |
909 storage_partition_impl_->GetIndexedDBContext(), | 913 storage_partition_impl_->GetIndexedDBContext(), |
910 ChromeBlobStorageContext::GetFor(browser_context))); | 914 chrome_blob_storage_context)); |
911 | 915 |
912 gpu_message_filter_ = new GpuMessageFilter(GetID()); | 916 gpu_message_filter_ = new GpuMessageFilter(GetID()); |
913 AddFilter(gpu_message_filter_); | 917 AddFilter(gpu_message_filter_); |
914 #if defined(ENABLE_WEBRTC) | 918 #if defined(ENABLE_WEBRTC) |
915 AddFilter(new WebRTCIdentityServiceHost( | 919 AddFilter(new WebRTCIdentityServiceHost( |
916 GetID(), storage_partition_impl_->GetWebRTCIdentityStore(), | 920 GetID(), storage_partition_impl_->GetWebRTCIdentityStore(), |
917 resource_context)); | 921 resource_context)); |
918 peer_connection_tracker_host_ = new PeerConnectionTrackerHost(GetID()); | 922 peer_connection_tracker_host_ = new PeerConnectionTrackerHost(GetID()); |
919 AddFilter(peer_connection_tracker_host_.get()); | 923 AddFilter(peer_connection_tracker_host_.get()); |
920 AddFilter(new MediaStreamDispatcherHost( | 924 AddFilter(new MediaStreamDispatcherHost( |
921 GetID(), browser_context->GetResourceContext()->GetMediaDeviceIDSalt(), | 925 GetID(), browser_context->GetResourceContext()->GetMediaDeviceIDSalt(), |
922 media_stream_manager)); | 926 media_stream_manager)); |
923 AddFilter(new MediaStreamTrackMetricsHost()); | 927 AddFilter(new MediaStreamTrackMetricsHost()); |
924 #endif | 928 #endif |
925 #if defined(ENABLE_PLUGINS) | 929 #if defined(ENABLE_PLUGINS) |
926 AddFilter(new PepperRendererConnection(GetID())); | 930 AddFilter(new PepperRendererConnection(GetID())); |
927 #endif | 931 #endif |
928 AddFilter(new SpeechRecognitionDispatcherHost( | 932 AddFilter(new SpeechRecognitionDispatcherHost( |
929 GetID(), storage_partition_impl_->GetURLRequestContext())); | 933 GetID(), storage_partition_impl_->GetURLRequestContext())); |
930 AddFilter(new FileAPIMessageFilter( | 934 AddFilter(new FileAPIMessageFilter( |
931 GetID(), storage_partition_impl_->GetURLRequestContext(), | 935 GetID(), storage_partition_impl_->GetURLRequestContext(), |
932 storage_partition_impl_->GetFileSystemContext(), | 936 storage_partition_impl_->GetFileSystemContext(), |
933 ChromeBlobStorageContext::GetFor(browser_context), | 937 chrome_blob_storage_context, StreamContext::GetFor(browser_context))); |
934 StreamContext::GetFor(browser_context))); | |
935 AddFilter(new FileUtilitiesMessageFilter(GetID())); | 938 AddFilter(new FileUtilitiesMessageFilter(GetID())); |
936 AddFilter(new MimeRegistryMessageFilter()); | 939 AddFilter(new MimeRegistryMessageFilter()); |
937 AddFilter( | 940 AddFilter( |
938 new DatabaseMessageFilter(storage_partition_impl_->GetDatabaseTracker())); | 941 new DatabaseMessageFilter(storage_partition_impl_->GetDatabaseTracker())); |
939 #if defined(OS_MACOSX) | 942 #if defined(OS_MACOSX) |
940 AddFilter(new TextInputClientMessageFilter(GetID())); | 943 AddFilter(new TextInputClientMessageFilter(GetID())); |
941 #elif defined(OS_WIN) | 944 #elif defined(OS_WIN) |
942 AddFilter(new DWriteFontProxyMessageFilter()); | 945 AddFilter(new DWriteFontProxyMessageFilter()); |
943 | 946 |
944 // The FontCacheDispatcher is required only when we're using GDI rendering. | 947 // The FontCacheDispatcher is required only when we're using GDI rendering. |
945 // TODO(scottmg): pdf/ppapi still require the renderer to be able to precache | 948 // TODO(scottmg): pdf/ppapi still require the renderer to be able to precache |
946 // GDI fonts (http://crbug.com/383227), even when using DirectWrite. This | 949 // GDI fonts (http://crbug.com/383227), even when using DirectWrite. This |
947 // should eventually be if (!ShouldUseDirectWrite()) guarded. | 950 // should eventually be if (!ShouldUseDirectWrite()) guarded. |
948 channel_->AddFilter(new FontCacheDispatcher()); | 951 channel_->AddFilter(new FontCacheDispatcher()); |
949 #elif defined(OS_ANDROID) | 952 #elif defined(OS_ANDROID) |
950 browser_demuxer_android_ = new BrowserDemuxerAndroid(); | 953 browser_demuxer_android_ = new BrowserDemuxerAndroid(); |
951 AddFilter(browser_demuxer_android_.get()); | 954 AddFilter(browser_demuxer_android_.get()); |
952 #endif | 955 #endif |
953 #if defined(ENABLE_BROWSER_CDMS) | 956 #if defined(ENABLE_BROWSER_CDMS) |
954 AddFilter(new BrowserCdmManager(GetID(), NULL)); | 957 AddFilter(new BrowserCdmManager(GetID(), NULL)); |
955 #endif | 958 #endif |
956 | 959 |
957 WebSocketDispatcherHost::GetRequestContextCallback | 960 WebSocketDispatcherHost::GetRequestContextCallback |
958 websocket_request_context_callback( | 961 websocket_request_context_callback( |
959 base::Bind(&GetRequestContext, request_context, media_request_context, | 962 base::Bind(&GetRequestContext, request_context, media_request_context, |
960 RESOURCE_TYPE_SUB_RESOURCE)); | 963 RESOURCE_TYPE_SUB_RESOURCE)); |
961 | 964 |
962 AddFilter( | 965 AddFilter(new WebSocketDispatcherHost( |
963 new WebSocketDispatcherHost(GetID(), websocket_request_context_callback)); | 966 GetID(), websocket_request_context_callback, chrome_blob_storage_context, |
967 storage_partition_impl_)); | |
964 | 968 |
965 message_port_message_filter_ = new MessagePortMessageFilter( | 969 message_port_message_filter_ = new MessagePortMessageFilter( |
966 base::Bind(&RenderWidgetHelper::GetNextRoutingID, | 970 base::Bind(&RenderWidgetHelper::GetNextRoutingID, |
967 base::Unretained(widget_helper_.get()))); | 971 base::Unretained(widget_helper_.get()))); |
968 AddFilter(message_port_message_filter_.get()); | 972 AddFilter(message_port_message_filter_.get()); |
969 | 973 |
970 scoped_refptr<CacheStorageDispatcherHost> cache_storage_filter = | 974 scoped_refptr<CacheStorageDispatcherHost> cache_storage_filter = |
971 new CacheStorageDispatcherHost(); | 975 new CacheStorageDispatcherHost(); |
972 cache_storage_filter->Init(storage_partition_impl_->GetCacheStorageContext()); | 976 cache_storage_filter->Init(storage_partition_impl_->GetCacheStorageContext()); |
973 AddFilter(cache_storage_filter.get()); | 977 AddFilter(cache_storage_filter.get()); |
(...skipping 1789 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2763 void RenderProcessHostImpl::GetAudioOutputControllers( | 2767 void RenderProcessHostImpl::GetAudioOutputControllers( |
2764 const GetAudioOutputControllersCallback& callback) const { | 2768 const GetAudioOutputControllersCallback& callback) const { |
2765 audio_renderer_host()->GetOutputControllers(callback); | 2769 audio_renderer_host()->GetOutputControllers(callback); |
2766 } | 2770 } |
2767 | 2771 |
2768 BluetoothDispatcherHost* RenderProcessHostImpl::GetBluetoothDispatcherHost() { | 2772 BluetoothDispatcherHost* RenderProcessHostImpl::GetBluetoothDispatcherHost() { |
2769 return bluetooth_dispatcher_host_.get(); | 2773 return bluetooth_dispatcher_host_.get(); |
2770 } | 2774 } |
2771 | 2775 |
2772 } // namespace content | 2776 } // namespace content |
OLD | NEW |