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 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
52 #include "content/browser/bad_message.h" | 52 #include "content/browser/bad_message.h" |
53 #include "content/browser/blob_storage/blob_dispatcher_host.h" | 53 #include "content/browser/blob_storage/blob_dispatcher_host.h" |
54 #include "content/browser/blob_storage/chrome_blob_storage_context.h" | 54 #include "content/browser/blob_storage/chrome_blob_storage_context.h" |
55 #include "content/browser/browser_child_process_host_impl.h" | 55 #include "content/browser/browser_child_process_host_impl.h" |
56 #include "content/browser/browser_main.h" | 56 #include "content/browser/browser_main.h" |
57 #include "content/browser/browser_main_loop.h" | 57 #include "content/browser/browser_main_loop.h" |
58 #include "content/browser/browser_plugin/browser_plugin_message_filter.h" | 58 #include "content/browser/browser_plugin/browser_plugin_message_filter.h" |
59 #include "content/browser/cache_storage/cache_storage_context_impl.h" | 59 #include "content/browser/cache_storage/cache_storage_context_impl.h" |
60 #include "content/browser/cache_storage/cache_storage_dispatcher_host.h" | 60 #include "content/browser/cache_storage/cache_storage_dispatcher_host.h" |
61 #include "content/browser/child_process_security_policy_impl.h" | 61 #include "content/browser/child_process_security_policy_impl.h" |
62 #include "content/browser/device_sensors/device_light_message_filter.h" | 62 #include "content/browser/device_sensors/device_sensor_host.h" |
63 #include "content/browser/device_sensors/device_motion_message_filter.h" | |
64 #include "content/browser/device_sensors/device_orientation_absolute_message_fil
ter.h" | |
65 #include "content/browser/device_sensors/device_orientation_message_filter.h" | |
66 #include "content/browser/dom_storage/dom_storage_context_wrapper.h" | 63 #include "content/browser/dom_storage/dom_storage_context_wrapper.h" |
67 #include "content/browser/dom_storage/dom_storage_message_filter.h" | 64 #include "content/browser/dom_storage/dom_storage_message_filter.h" |
68 #include "content/browser/fileapi/fileapi_message_filter.h" | 65 #include "content/browser/fileapi/fileapi_message_filter.h" |
69 #include "content/browser/frame_host/render_frame_message_filter.h" | 66 #include "content/browser/frame_host/render_frame_message_filter.h" |
70 #include "content/browser/gpu/browser_gpu_memory_buffer_manager.h" | 67 #include "content/browser/gpu/browser_gpu_memory_buffer_manager.h" |
71 #include "content/browser/gpu/compositor_util.h" | 68 #include "content/browser/gpu/compositor_util.h" |
72 #include "content/browser/gpu/gpu_data_manager_impl.h" | 69 #include "content/browser/gpu/gpu_data_manager_impl.h" |
73 #include "content/browser/gpu/gpu_process_host.h" | 70 #include "content/browser/gpu/gpu_process_host.h" |
74 #include "content/browser/gpu/shader_disk_cache.h" | 71 #include "content/browser/gpu/shader_disk_cache.h" |
75 #include "content/browser/histogram_message_filter.h" | 72 #include "content/browser/histogram_message_filter.h" |
(...skipping 926 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1002 AddFilter(new QuotaDispatcherHost( | 999 AddFilter(new QuotaDispatcherHost( |
1003 GetID(), storage_partition_impl_->GetQuotaManager(), | 1000 GetID(), storage_partition_impl_->GetQuotaManager(), |
1004 GetContentClient()->browser()->CreateQuotaPermissionContext())); | 1001 GetContentClient()->browser()->CreateQuotaPermissionContext())); |
1005 | 1002 |
1006 notification_message_filter_ = new NotificationMessageFilter( | 1003 notification_message_filter_ = new NotificationMessageFilter( |
1007 GetID(), storage_partition_impl_->GetPlatformNotificationContext(), | 1004 GetID(), storage_partition_impl_->GetPlatformNotificationContext(), |
1008 resource_context, browser_context); | 1005 resource_context, browser_context); |
1009 AddFilter(notification_message_filter_.get()); | 1006 AddFilter(notification_message_filter_.get()); |
1010 | 1007 |
1011 AddFilter(new GamepadBrowserMessageFilter()); | 1008 AddFilter(new GamepadBrowserMessageFilter()); |
1012 AddFilter(new DeviceLightMessageFilter()); | |
1013 AddFilter(new DeviceMotionMessageFilter()); | |
1014 AddFilter(new DeviceOrientationMessageFilter()); | |
1015 AddFilter(new DeviceOrientationAbsoluteMessageFilter()); | |
1016 AddFilter(new ProfilerMessageFilter(PROCESS_TYPE_RENDERER)); | 1009 AddFilter(new ProfilerMessageFilter(PROCESS_TYPE_RENDERER)); |
1017 AddFilter(new HistogramMessageFilter()); | 1010 AddFilter(new HistogramMessageFilter()); |
1018 AddFilter(new MemoryMessageFilter(this)); | 1011 AddFilter(new MemoryMessageFilter(this)); |
1019 AddFilter(new PushMessagingMessageFilter( | 1012 AddFilter(new PushMessagingMessageFilter( |
1020 GetID(), storage_partition_impl_->GetServiceWorkerContext())); | 1013 GetID(), storage_partition_impl_->GetServiceWorkerContext())); |
1021 #if defined(OS_ANDROID) | 1014 #if defined(OS_ANDROID) |
1022 AddFilter(new ScreenOrientationMessageFilterAndroid()); | 1015 AddFilter(new ScreenOrientationMessageFilterAndroid()); |
1023 #endif | 1016 #endif |
1024 } | 1017 } |
1025 | 1018 |
(...skipping 24 matching lines...) Expand all Loading... |
1050 storage_partition_impl_->GetPlatformNotificationContext()), GetID())); | 1043 storage_partition_impl_->GetPlatformNotificationContext()), GetID())); |
1051 | 1044 |
1052 mojo_application_host_->service_registry()->AddService( | 1045 mojo_application_host_->service_registry()->AddService( |
1053 base::Bind(&RenderProcessHostImpl::CreateStoragePartitionService, | 1046 base::Bind(&RenderProcessHostImpl::CreateStoragePartitionService, |
1054 base::Unretained(this))); | 1047 base::Unretained(this))); |
1055 | 1048 |
1056 mojo_application_host_->service_registry()->AddService( | 1049 mojo_application_host_->service_registry()->AddService( |
1057 base::Bind(&MimeRegistryImpl::Create), | 1050 base::Bind(&MimeRegistryImpl::Create), |
1058 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::FILE)); | 1051 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::FILE)); |
1059 | 1052 |
| 1053 scoped_refptr<base::SingleThreadTaskRunner> io_task_runner = |
| 1054 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO); |
| 1055 mojo_application_host_->service_registry()->AddService( |
| 1056 base::Bind(&DeviceLightHost::Create), io_task_runner); |
| 1057 mojo_application_host_->service_registry()->AddService( |
| 1058 base::Bind(&DeviceMotionHost::Create), io_task_runner); |
| 1059 mojo_application_host_->service_registry()->AddService( |
| 1060 base::Bind(&DeviceOrientationHost::Create), io_task_runner); |
| 1061 mojo_application_host_->service_registry()->AddService( |
| 1062 base::Bind(&DeviceOrientationAbsoluteHost::Create), io_task_runner); |
| 1063 |
1060 #if defined(OS_ANDROID) | 1064 #if defined(OS_ANDROID) |
1061 ServiceRegistrarAndroid::RegisterProcessHostServices( | 1065 ServiceRegistrarAndroid::RegisterProcessHostServices( |
1062 mojo_application_host_->service_registry_android()); | 1066 mojo_application_host_->service_registry_android()); |
1063 #endif | 1067 #endif |
1064 | 1068 |
1065 GetContentClient()->browser()->RegisterRenderProcessMojoServices( | 1069 GetContentClient()->browser()->RegisterRenderProcessMojoServices( |
1066 mojo_application_host_->service_registry(), this); | 1070 mojo_application_host_->service_registry(), this); |
1067 } | 1071 } |
1068 | 1072 |
1069 void RenderProcessHostImpl::CreateStoragePartitionService( | 1073 void RenderProcessHostImpl::CreateStoragePartitionService( |
(...skipping 1744 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2814 LOG(ERROR) << "Terminating render process for bad Mojo message: " << error; | 2818 LOG(ERROR) << "Terminating render process for bad Mojo message: " << error; |
2815 | 2819 |
2816 // The ReceivedBadMessage call below will trigger a DumpWithoutCrashing. Alias | 2820 // The ReceivedBadMessage call below will trigger a DumpWithoutCrashing. Alias |
2817 // enough information here so that we can determine what the bad message was. | 2821 // enough information here so that we can determine what the bad message was. |
2818 base::debug::Alias(&error); | 2822 base::debug::Alias(&error); |
2819 bad_message::ReceivedBadMessage(process.get(), | 2823 bad_message::ReceivedBadMessage(process.get(), |
2820 bad_message::RPH_MOJO_PROCESS_ERROR); | 2824 bad_message::RPH_MOJO_PROCESS_ERROR); |
2821 } | 2825 } |
2822 | 2826 |
2823 } // namespace content | 2827 } // namespace content |
OLD | NEW |