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 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
53 #include "content/browser/bad_message.h" | 53 #include "content/browser/bad_message.h" |
54 #include "content/browser/blob_storage/blob_dispatcher_host.h" | 54 #include "content/browser/blob_storage/blob_dispatcher_host.h" |
55 #include "content/browser/blob_storage/chrome_blob_storage_context.h" | 55 #include "content/browser/blob_storage/chrome_blob_storage_context.h" |
56 #include "content/browser/browser_child_process_host_impl.h" | 56 #include "content/browser/browser_child_process_host_impl.h" |
57 #include "content/browser/browser_main.h" | 57 #include "content/browser/browser_main.h" |
58 #include "content/browser/browser_main_loop.h" | 58 #include "content/browser/browser_main_loop.h" |
59 #include "content/browser/browser_plugin/browser_plugin_message_filter.h" | 59 #include "content/browser/browser_plugin/browser_plugin_message_filter.h" |
60 #include "content/browser/cache_storage/cache_storage_context_impl.h" | 60 #include "content/browser/cache_storage/cache_storage_context_impl.h" |
61 #include "content/browser/cache_storage/cache_storage_dispatcher_host.h" | 61 #include "content/browser/cache_storage/cache_storage_dispatcher_host.h" |
62 #include "content/browser/child_process_security_policy_impl.h" | 62 #include "content/browser/child_process_security_policy_impl.h" |
63 #include "content/browser/device_sensors/device_light_message_filter.h" | 63 #include "content/browser/device_sensors/device_sensor_host.h" |
64 #include "content/browser/device_sensors/device_motion_message_filter.h" | |
65 #include "content/browser/device_sensors/device_orientation_absolute_message_fil
ter.h" | |
66 #include "content/browser/device_sensors/device_orientation_message_filter.h" | |
67 #include "content/browser/dom_storage/dom_storage_context_wrapper.h" | 64 #include "content/browser/dom_storage/dom_storage_context_wrapper.h" |
68 #include "content/browser/dom_storage/dom_storage_message_filter.h" | 65 #include "content/browser/dom_storage/dom_storage_message_filter.h" |
69 #include "content/browser/fileapi/fileapi_message_filter.h" | 66 #include "content/browser/fileapi/fileapi_message_filter.h" |
70 #include "content/browser/frame_host/render_frame_message_filter.h" | 67 #include "content/browser/frame_host/render_frame_message_filter.h" |
71 #include "content/browser/gpu/browser_gpu_memory_buffer_manager.h" | 68 #include "content/browser/gpu/browser_gpu_memory_buffer_manager.h" |
72 #include "content/browser/gpu/compositor_util.h" | 69 #include "content/browser/gpu/compositor_util.h" |
73 #include "content/browser/gpu/gpu_data_manager_impl.h" | 70 #include "content/browser/gpu/gpu_data_manager_impl.h" |
74 #include "content/browser/gpu/gpu_process_host.h" | 71 #include "content/browser/gpu/gpu_process_host.h" |
75 #include "content/browser/gpu/shader_disk_cache.h" | 72 #include "content/browser/gpu/shader_disk_cache.h" |
76 #include "content/browser/histogram_message_filter.h" | 73 #include "content/browser/histogram_message_filter.h" |
(...skipping 931 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1008 AddFilter(new QuotaDispatcherHost( | 1005 AddFilter(new QuotaDispatcherHost( |
1009 GetID(), storage_partition_impl_->GetQuotaManager(), | 1006 GetID(), storage_partition_impl_->GetQuotaManager(), |
1010 GetContentClient()->browser()->CreateQuotaPermissionContext())); | 1007 GetContentClient()->browser()->CreateQuotaPermissionContext())); |
1011 | 1008 |
1012 notification_message_filter_ = new NotificationMessageFilter( | 1009 notification_message_filter_ = new NotificationMessageFilter( |
1013 GetID(), storage_partition_impl_->GetPlatformNotificationContext(), | 1010 GetID(), storage_partition_impl_->GetPlatformNotificationContext(), |
1014 resource_context, browser_context); | 1011 resource_context, browser_context); |
1015 AddFilter(notification_message_filter_.get()); | 1012 AddFilter(notification_message_filter_.get()); |
1016 | 1013 |
1017 AddFilter(new GamepadBrowserMessageFilter()); | 1014 AddFilter(new GamepadBrowserMessageFilter()); |
1018 AddFilter(new DeviceLightMessageFilter()); | |
1019 AddFilter(new DeviceMotionMessageFilter()); | |
1020 AddFilter(new DeviceOrientationMessageFilter()); | |
1021 AddFilter(new DeviceOrientationAbsoluteMessageFilter()); | |
1022 AddFilter(new ProfilerMessageFilter(PROCESS_TYPE_RENDERER)); | 1015 AddFilter(new ProfilerMessageFilter(PROCESS_TYPE_RENDERER)); |
1023 AddFilter(new HistogramMessageFilter()); | 1016 AddFilter(new HistogramMessageFilter()); |
1024 AddFilter(new MemoryMessageFilter(this)); | 1017 AddFilter(new MemoryMessageFilter(this)); |
1025 AddFilter(new PushMessagingMessageFilter( | 1018 AddFilter(new PushMessagingMessageFilter( |
1026 GetID(), storage_partition_impl_->GetServiceWorkerContext())); | 1019 GetID(), storage_partition_impl_->GetServiceWorkerContext())); |
1027 #if defined(OS_ANDROID) | 1020 #if defined(OS_ANDROID) |
1028 AddFilter(new ScreenOrientationMessageFilterAndroid()); | 1021 AddFilter(new ScreenOrientationMessageFilterAndroid()); |
1029 #endif | 1022 #endif |
1030 } | 1023 } |
1031 | 1024 |
(...skipping 29 matching lines...) Expand all Loading... |
1061 | 1054 |
1062 GetInterfaceRegistry()->AddInterface( | 1055 GetInterfaceRegistry()->AddInterface( |
1063 base::Bind(&webmessaging::BroadcastChannelProvider::Connect, | 1056 base::Bind(&webmessaging::BroadcastChannelProvider::Connect, |
1064 base::Unretained( | 1057 base::Unretained( |
1065 storage_partition_impl_->GetBroadcastChannelProvider()))); | 1058 storage_partition_impl_->GetBroadcastChannelProvider()))); |
1066 | 1059 |
1067 GetInterfaceRegistry()->AddInterface( | 1060 GetInterfaceRegistry()->AddInterface( |
1068 base::Bind(&MimeRegistryImpl::Create), | 1061 base::Bind(&MimeRegistryImpl::Create), |
1069 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::FILE)); | 1062 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::FILE)); |
1070 | 1063 |
| 1064 scoped_refptr<base::SingleThreadTaskRunner> io_task_runner = |
| 1065 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO); |
| 1066 GetInterfaceRegistry()->AddInterface(base::Bind(&DeviceLightHost::Create), |
| 1067 io_task_runner); |
| 1068 GetInterfaceRegistry()->AddInterface(base::Bind(&DeviceMotionHost::Create), |
| 1069 io_task_runner); |
| 1070 GetInterfaceRegistry()->AddInterface( |
| 1071 base::Bind(&DeviceOrientationHost::Create), io_task_runner); |
| 1072 GetInterfaceRegistry()->AddInterface( |
| 1073 base::Bind(&DeviceOrientationAbsoluteHost::Create), io_task_runner); |
| 1074 |
1071 #if defined(OS_ANDROID) | 1075 #if defined(OS_ANDROID) |
1072 ServiceRegistrarAndroid::RegisterProcessHostServices( | 1076 ServiceRegistrarAndroid::RegisterProcessHostServices( |
1073 mojo_child_connection_->service_registry_android()); | 1077 mojo_child_connection_->service_registry_android()); |
1074 #endif | 1078 #endif |
1075 | 1079 |
1076 GetContentClient()->browser()->ExposeInterfacesToRenderer( | 1080 GetContentClient()->browser()->ExposeInterfacesToRenderer( |
1077 GetInterfaceRegistry(), this); | 1081 GetInterfaceRegistry(), this); |
1078 } | 1082 } |
1079 | 1083 |
1080 void RenderProcessHostImpl::CreateStoragePartitionService( | 1084 void RenderProcessHostImpl::CreateStoragePartitionService( |
(...skipping 1746 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2827 LOG(ERROR) << "Terminating render process for bad Mojo message: " << error; | 2831 LOG(ERROR) << "Terminating render process for bad Mojo message: " << error; |
2828 | 2832 |
2829 // The ReceivedBadMessage call below will trigger a DumpWithoutCrashing. Alias | 2833 // The ReceivedBadMessage call below will trigger a DumpWithoutCrashing. Alias |
2830 // enough information here so that we can determine what the bad message was. | 2834 // enough information here so that we can determine what the bad message was. |
2831 base::debug::Alias(&error); | 2835 base::debug::Alias(&error); |
2832 bad_message::ReceivedBadMessage(process.get(), | 2836 bad_message::ReceivedBadMessage(process.get(), |
2833 bad_message::RPH_MOJO_PROCESS_ERROR); | 2837 bad_message::RPH_MOJO_PROCESS_ERROR); |
2834 } | 2838 } |
2835 | 2839 |
2836 } // namespace content | 2840 } // namespace content |
OLD | NEW |