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 1038 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1049 request_context.get(), | 1049 request_context.get(), |
1050 widget_helper_.get()); | 1050 widget_helper_.get()); |
1051 AddFilter(render_frame_message_filter_.get()); | 1051 AddFilter(render_frame_message_filter_.get()); |
1052 | 1052 |
1053 BrowserContext* browser_context = GetBrowserContext(); | 1053 BrowserContext* browser_context = GetBrowserContext(); |
1054 ResourceContext* resource_context = browser_context->GetResourceContext(); | 1054 ResourceContext* resource_context = browser_context->GetResourceContext(); |
1055 | 1055 |
1056 scoped_refptr<net::URLRequestContextGetter> media_request_context( | 1056 scoped_refptr<net::URLRequestContextGetter> media_request_context( |
1057 GetStoragePartition()->GetMediaURLRequestContext()); | 1057 GetStoragePartition()->GetMediaURLRequestContext()); |
1058 | 1058 |
1059 ResourceMessageFilter::GetContextsCallback get_contexts_callback( | 1059 ResourceMessageFilter::GetContextsCallback get_contexts_callback(base::Bind( |
1060 base::Bind(&GetContexts, browser_context->GetResourceContext(), | 1060 &GetContexts, resource_context, request_context, media_request_context)); |
1061 request_context, media_request_context)); | |
1062 | 1061 |
1063 // Several filters need the Blob storage context, so fetch it in advance. | 1062 // Several filters need the Blob storage context, so fetch it in advance. |
1064 scoped_refptr<ChromeBlobStorageContext> blob_storage_context = | 1063 scoped_refptr<ChromeBlobStorageContext> blob_storage_context = |
1065 ChromeBlobStorageContext::GetFor(browser_context); | 1064 ChromeBlobStorageContext::GetFor(browser_context); |
1066 | 1065 |
1067 resource_message_filter_ = new ResourceMessageFilter( | 1066 resource_message_filter_ = new ResourceMessageFilter( |
1068 GetID(), storage_partition_impl_->GetAppCacheService(), | 1067 GetID(), storage_partition_impl_->GetAppCacheService(), |
1069 blob_storage_context.get(), | 1068 blob_storage_context.get(), |
1070 storage_partition_impl_->GetFileSystemContext(), | 1069 storage_partition_impl_->GetFileSystemContext(), |
1071 storage_partition_impl_->GetServiceWorkerContext(), get_contexts_callback, | 1070 storage_partition_impl_->GetServiceWorkerContext(), get_contexts_callback, |
1072 BrowserThread::GetTaskRunnerForThread(BrowserThread::IO)); | 1071 BrowserThread::GetTaskRunnerForThread(BrowserThread::IO)); |
1073 | 1072 |
1074 AddFilter(resource_message_filter_.get()); | 1073 AddFilter(resource_message_filter_.get()); |
1075 | 1074 |
1076 media::AudioManager* audio_manager = | 1075 media::AudioManager* audio_manager = |
1077 BrowserMainLoop::GetInstance()->audio_manager(); | 1076 BrowserMainLoop::GetInstance()->audio_manager(); |
1078 MediaStreamManager* media_stream_manager = | 1077 MediaStreamManager* media_stream_manager = |
1079 BrowserMainLoop::GetInstance()->media_stream_manager(); | 1078 BrowserMainLoop::GetInstance()->media_stream_manager(); |
1080 // The AudioInputRendererHost and AudioRendererHost needs to be available for | 1079 // The AudioInputRendererHost and AudioRendererHost needs to be available for |
1081 // lookup, so it's stashed in a member variable. | 1080 // lookup, so it's stashed in a member variable. |
1082 audio_input_renderer_host_ = new AudioInputRendererHost( | 1081 audio_input_renderer_host_ = new AudioInputRendererHost( |
1083 GetID(), audio_manager, media_stream_manager, | 1082 GetID(), audio_manager, media_stream_manager, |
1084 AudioMirroringManager::GetInstance(), | 1083 AudioMirroringManager::GetInstance(), |
1085 BrowserMainLoop::GetInstance()->user_input_monitor()); | 1084 BrowserMainLoop::GetInstance()->user_input_monitor()); |
1086 AddFilter(audio_input_renderer_host_.get()); | 1085 AddFilter(audio_input_renderer_host_.get()); |
1087 audio_renderer_host_ = new AudioRendererHost( | 1086 audio_renderer_host_ = new AudioRendererHost( |
1088 GetID(), audio_manager, BrowserMainLoop::GetInstance()->audio_system(), | 1087 GetID(), audio_manager, BrowserMainLoop::GetInstance()->audio_system(), |
1089 AudioMirroringManager::GetInstance(), media_stream_manager, | 1088 AudioMirroringManager::GetInstance(), media_stream_manager, |
1090 browser_context->GetResourceContext()->GetMediaDeviceIDSalt()); | 1089 browser_context->GetMediaDeviceIDSalt()); |
1091 AddFilter(audio_renderer_host_.get()); | 1090 AddFilter(audio_renderer_host_.get()); |
1092 AddFilter( | 1091 AddFilter( |
1093 new MidiHost(GetID(), BrowserMainLoop::GetInstance()->midi_service())); | 1092 new MidiHost(GetID(), BrowserMainLoop::GetInstance()->midi_service())); |
1094 AddFilter(new AppCacheDispatcherHost( | 1093 AddFilter(new AppCacheDispatcherHost( |
1095 storage_partition_impl_->GetAppCacheService(), GetID())); | 1094 storage_partition_impl_->GetAppCacheService(), GetID())); |
1096 AddFilter(new ClipboardMessageFilter(blob_storage_context)); | 1095 AddFilter(new ClipboardMessageFilter(blob_storage_context)); |
1097 AddFilter(new DOMStorageMessageFilter( | 1096 AddFilter(new DOMStorageMessageFilter( |
1098 storage_partition_impl_->GetDOMStorageContext())); | 1097 storage_partition_impl_->GetDOMStorageContext())); |
1099 | 1098 |
1100 #if BUILDFLAG(ENABLE_WEBRTC) | 1099 #if BUILDFLAG(ENABLE_WEBRTC) |
1101 peer_connection_tracker_host_ = new PeerConnectionTrackerHost( | 1100 peer_connection_tracker_host_ = new PeerConnectionTrackerHost( |
1102 GetID(), webrtc_eventlog_host_.GetWeakPtr()); | 1101 GetID(), webrtc_eventlog_host_.GetWeakPtr()); |
1103 AddFilter(peer_connection_tracker_host_.get()); | 1102 AddFilter(peer_connection_tracker_host_.get()); |
1104 AddFilter(new MediaStreamDispatcherHost( | 1103 AddFilter(new MediaStreamDispatcherHost( |
1105 GetID(), browser_context->GetResourceContext()->GetMediaDeviceIDSalt(), | 1104 GetID(), browser_context->GetMediaDeviceIDSalt(), media_stream_manager)); |
1106 media_stream_manager)); | |
1107 AddFilter(new MediaStreamTrackMetricsHost()); | 1105 AddFilter(new MediaStreamTrackMetricsHost()); |
1108 #endif | 1106 #endif |
1109 #if BUILDFLAG(ENABLE_PLUGINS) | 1107 #if BUILDFLAG(ENABLE_PLUGINS) |
1110 AddFilter(new PepperRendererConnection(GetID())); | 1108 AddFilter(new PepperRendererConnection(GetID())); |
1111 #endif | 1109 #endif |
1112 AddFilter(new SpeechRecognitionDispatcherHost( | 1110 AddFilter(new SpeechRecognitionDispatcherHost( |
1113 GetID(), storage_partition_impl_->GetURLRequestContext())); | 1111 GetID(), storage_partition_impl_->GetURLRequestContext())); |
1114 AddFilter(new FileAPIMessageFilter( | 1112 AddFilter(new FileAPIMessageFilter( |
1115 GetID(), storage_partition_impl_->GetURLRequestContext(), | 1113 GetID(), storage_partition_impl_->GetURLRequestContext(), |
1116 storage_partition_impl_->GetFileSystemContext(), | 1114 storage_partition_impl_->GetFileSystemContext(), |
(...skipping 1961 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3078 LOG(ERROR) << "Terminating render process for bad Mojo message: " << error; | 3076 LOG(ERROR) << "Terminating render process for bad Mojo message: " << error; |
3079 | 3077 |
3080 // The ReceivedBadMessage call below will trigger a DumpWithoutCrashing. | 3078 // The ReceivedBadMessage call below will trigger a DumpWithoutCrashing. |
3081 // Capture the error message in a crash key value. | 3079 // Capture the error message in a crash key value. |
3082 base::debug::ScopedCrashKey error_key_value("mojo-message-error", error); | 3080 base::debug::ScopedCrashKey error_key_value("mojo-message-error", error); |
3083 bad_message::ReceivedBadMessage(render_process_id, | 3081 bad_message::ReceivedBadMessage(render_process_id, |
3084 bad_message::RPH_MOJO_PROCESS_ERROR); | 3082 bad_message::RPH_MOJO_PROCESS_ERROR); |
3085 } | 3083 } |
3086 | 3084 |
3087 } // namespace content | 3085 } // namespace content |
OLD | NEW |