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 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
89 #include "content/browser/media/midi_host.h" | 89 #include "content/browser/media/midi_host.h" |
90 #include "content/browser/memory/memory_coordinator_impl.h" | 90 #include "content/browser/memory/memory_coordinator_impl.h" |
91 #include "content/browser/memory/memory_message_filter.h" | 91 #include "content/browser/memory/memory_message_filter.h" |
92 #include "content/browser/mime_registry_impl.h" | 92 #include "content/browser/mime_registry_impl.h" |
93 #include "content/browser/notifications/notification_message_filter.h" | 93 #include "content/browser/notifications/notification_message_filter.h" |
94 #include "content/browser/notifications/platform_notification_context_impl.h" | 94 #include "content/browser/notifications/platform_notification_context_impl.h" |
95 #include "content/browser/payments/payment_app_manager.h" | 95 #include "content/browser/payments/payment_app_manager.h" |
96 #include "content/browser/permissions/permission_service_context.h" | 96 #include "content/browser/permissions/permission_service_context.h" |
97 #include "content/browser/permissions/permission_service_impl.h" | 97 #include "content/browser/permissions/permission_service_impl.h" |
98 #include "content/browser/profiler_message_filter.h" | 98 #include "content/browser/profiler_message_filter.h" |
99 #include "content/browser/push_messaging/push_messaging_message_filter.h" | 99 #include "content/browser/push_messaging/push_messaging_manager.h" |
100 #include "content/browser/quota_dispatcher_host.h" | 100 #include "content/browser/quota_dispatcher_host.h" |
101 #include "content/browser/renderer_host/clipboard_message_filter.h" | 101 #include "content/browser/renderer_host/clipboard_message_filter.h" |
102 #include "content/browser/renderer_host/database_message_filter.h" | 102 #include "content/browser/renderer_host/database_message_filter.h" |
103 #include "content/browser/renderer_host/file_utilities_message_filter.h" | 103 #include "content/browser/renderer_host/file_utilities_message_filter.h" |
104 #include "content/browser/renderer_host/media/audio_input_renderer_host.h" | 104 #include "content/browser/renderer_host/media/audio_input_renderer_host.h" |
105 #include "content/browser/renderer_host/media/audio_renderer_host.h" | 105 #include "content/browser/renderer_host/media/audio_renderer_host.h" |
106 #include "content/browser/renderer_host/media/media_stream_dispatcher_host.h" | 106 #include "content/browser/renderer_host/media/media_stream_dispatcher_host.h" |
107 #include "content/browser/renderer_host/media/peer_connection_tracker_host.h" | 107 #include "content/browser/renderer_host/media/peer_connection_tracker_host.h" |
108 #include "content/browser/renderer_host/media/video_capture_host.h" | 108 #include "content/browser/renderer_host/media/video_capture_host.h" |
109 #include "content/browser/renderer_host/offscreen_canvas_compositor_frame_sink_p
rovider_impl.h" | 109 #include "content/browser/renderer_host/offscreen_canvas_compositor_frame_sink_p
rovider_impl.h" |
(...skipping 611 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
721 mark_child_process_activity_time(); | 721 mark_child_process_activity_time(); |
722 | 722 |
723 if (!GetBrowserContext()->IsOffTheRecord() && | 723 if (!GetBrowserContext()->IsOffTheRecord() && |
724 !base::CommandLine::ForCurrentProcess()->HasSwitch( | 724 !base::CommandLine::ForCurrentProcess()->HasSwitch( |
725 switches::kDisableGpuShaderDiskCache)) { | 725 switches::kDisableGpuShaderDiskCache)) { |
726 BrowserThread::PostTask(BrowserThread::IO, FROM_HERE, | 726 BrowserThread::PostTask(BrowserThread::IO, FROM_HERE, |
727 base::Bind(&CacheShaderInfo, GetID(), | 727 base::Bind(&CacheShaderInfo, GetID(), |
728 storage_partition_impl_->GetPath())); | 728 storage_partition_impl_->GetPath())); |
729 } | 729 } |
730 | 730 |
| 731 push_messaging_manager_.reset(new PushMessagingManager( |
| 732 GetID(), storage_partition_impl_->GetServiceWorkerContext())); |
| 733 |
731 #if defined(OS_MACOSX) | 734 #if defined(OS_MACOSX) |
732 if (BootstrapSandboxManager::ShouldEnable()) | 735 if (BootstrapSandboxManager::ShouldEnable()) |
733 AddObserver(BootstrapSandboxManager::GetInstance()); | 736 AddObserver(BootstrapSandboxManager::GetInstance()); |
734 #endif | 737 #endif |
735 | 738 |
736 InitializeChannelProxy(); | 739 InitializeChannelProxy(); |
737 } | 740 } |
738 | 741 |
739 // static | 742 // static |
740 void RenderProcessHostImpl::ShutDownInProcessRenderer() { | 743 void RenderProcessHostImpl::ShutDownInProcessRenderer() { |
(...skipping 436 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1177 static_cast<ServiceWorkerContextWrapper*>( | 1180 static_cast<ServiceWorkerContextWrapper*>( |
1178 storage_partition_impl_->GetServiceWorkerContext())); | 1181 storage_partition_impl_->GetServiceWorkerContext())); |
1179 notification_message_filter_ = new NotificationMessageFilter( | 1182 notification_message_filter_ = new NotificationMessageFilter( |
1180 GetID(), storage_partition_impl_->GetPlatformNotificationContext(), | 1183 GetID(), storage_partition_impl_->GetPlatformNotificationContext(), |
1181 resource_context, service_worker_context, browser_context); | 1184 resource_context, service_worker_context, browser_context); |
1182 AddFilter(notification_message_filter_.get()); | 1185 AddFilter(notification_message_filter_.get()); |
1183 | 1186 |
1184 AddFilter(new ProfilerMessageFilter(PROCESS_TYPE_RENDERER)); | 1187 AddFilter(new ProfilerMessageFilter(PROCESS_TYPE_RENDERER)); |
1185 AddFilter(new HistogramMessageFilter()); | 1188 AddFilter(new HistogramMessageFilter()); |
1186 AddFilter(new MemoryMessageFilter(this)); | 1189 AddFilter(new MemoryMessageFilter(this)); |
1187 AddFilter(new PushMessagingMessageFilter( | |
1188 GetID(), storage_partition_impl_->GetServiceWorkerContext())); | |
1189 #if defined(OS_ANDROID) | 1190 #if defined(OS_ANDROID) |
1190 AddFilter(new ScreenOrientationListenerAndroid()); | 1191 AddFilter(new ScreenOrientationListenerAndroid()); |
1191 synchronous_compositor_filter_ = | 1192 synchronous_compositor_filter_ = |
1192 new SynchronousCompositorBrowserFilter(GetID()); | 1193 new SynchronousCompositorBrowserFilter(GetID()); |
1193 AddFilter(synchronous_compositor_filter_.get()); | 1194 AddFilter(synchronous_compositor_filter_.get()); |
1194 #endif | 1195 #endif |
1195 } | 1196 } |
1196 | 1197 |
1197 void RenderProcessHostImpl::RegisterMojoInterfaces() { | 1198 void RenderProcessHostImpl::RegisterMojoInterfaces() { |
1198 auto registry = base::MakeUnique<service_manager::InterfaceRegistry>( | 1199 auto registry = base::MakeUnique<service_manager::InterfaceRegistry>( |
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1301 // the IO thread. | 1302 // the IO thread. |
1302 registry->AddInterface(base::Bind(&device::DeviceLightHost::Create)); | 1303 registry->AddInterface(base::Bind(&device::DeviceLightHost::Create)); |
1303 registry->AddInterface(base::Bind(&device::DeviceMotionHost::Create)); | 1304 registry->AddInterface(base::Bind(&device::DeviceMotionHost::Create)); |
1304 registry->AddInterface(base::Bind(&device::DeviceOrientationHost::Create)); | 1305 registry->AddInterface(base::Bind(&device::DeviceOrientationHost::Create)); |
1305 registry->AddInterface( | 1306 registry->AddInterface( |
1306 base::Bind(&device::DeviceOrientationAbsoluteHost::Create)); | 1307 base::Bind(&device::DeviceOrientationAbsoluteHost::Create)); |
1307 #endif // defined(OS_ANDROID) | 1308 #endif // defined(OS_ANDROID) |
1308 | 1309 |
1309 registry->AddInterface(base::Bind(&device::GamepadMonitor::Create)); | 1310 registry->AddInterface(base::Bind(&device::GamepadMonitor::Create)); |
1310 | 1311 |
| 1312 registry->AddInterface( |
| 1313 base::Bind(&PushMessagingManager::BindRequest, |
| 1314 base::Unretained(push_messaging_manager_.get()))); |
| 1315 |
1311 registry->AddInterface(base::Bind(&RenderProcessHostImpl::CreateMusGpuRequest, | 1316 registry->AddInterface(base::Bind(&RenderProcessHostImpl::CreateMusGpuRequest, |
1312 base::Unretained(this))); | 1317 base::Unretained(this))); |
1313 | 1318 |
1314 registry->AddInterface( | 1319 registry->AddInterface( |
1315 base::Bind(&VideoCaptureHost::Create, | 1320 base::Bind(&VideoCaptureHost::Create, |
1316 BrowserMainLoop::GetInstance()->media_stream_manager())); | 1321 BrowserMainLoop::GetInstance()->media_stream_manager())); |
1317 | 1322 |
1318 // This is to support usage of WebSockets in cases in which there is no | 1323 // This is to support usage of WebSockets in cases in which there is no |
1319 // associated RenderFrame (e.g., Shared Workers). | 1324 // associated RenderFrame (e.g., Shared Workers). |
1320 AddUIThreadInterface( | 1325 AddUIThreadInterface( |
(...skipping 1739 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3060 LOG(ERROR) << "Terminating render process for bad Mojo message: " << error; | 3065 LOG(ERROR) << "Terminating render process for bad Mojo message: " << error; |
3061 | 3066 |
3062 // The ReceivedBadMessage call below will trigger a DumpWithoutCrashing. | 3067 // The ReceivedBadMessage call below will trigger a DumpWithoutCrashing. |
3063 // Capture the error message in a crash key value. | 3068 // Capture the error message in a crash key value. |
3064 base::debug::ScopedCrashKey error_key_value("mojo-message-error", error); | 3069 base::debug::ScopedCrashKey error_key_value("mojo-message-error", error); |
3065 bad_message::ReceivedBadMessage(render_process_id, | 3070 bad_message::ReceivedBadMessage(render_process_id, |
3066 bad_message::RPH_MOJO_PROCESS_ERROR); | 3071 bad_message::RPH_MOJO_PROCESS_ERROR); |
3067 } | 3072 } |
3068 | 3073 |
3069 } // namespace content | 3074 } // namespace content |
OLD | NEW |