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 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
69 #include "content/browser/indexed_db/indexed_db_context_impl.h" | 69 #include "content/browser/indexed_db/indexed_db_context_impl.h" |
70 #include "content/browser/indexed_db/indexed_db_dispatcher_host.h" | 70 #include "content/browser/indexed_db/indexed_db_dispatcher_host.h" |
71 #include "content/browser/loader/resource_message_filter.h" | 71 #include "content/browser/loader/resource_message_filter.h" |
72 #include "content/browser/loader/resource_scheduler_filter.h" | 72 #include "content/browser/loader/resource_scheduler_filter.h" |
73 #include "content/browser/media/capture/audio_mirroring_manager.h" | 73 #include "content/browser/media/capture/audio_mirroring_manager.h" |
74 #include "content/browser/media/media_internals.h" | 74 #include "content/browser/media/media_internals.h" |
75 #include "content/browser/media/midi_host.h" | 75 #include "content/browser/media/midi_host.h" |
76 #include "content/browser/message_port_message_filter.h" | 76 #include "content/browser/message_port_message_filter.h" |
77 #include "content/browser/mime_registry_message_filter.h" | 77 #include "content/browser/mime_registry_message_filter.h" |
78 #include "content/browser/mojo/mojo_application_host.h" | 78 #include "content/browser/mojo/mojo_application_host.h" |
79 #include "content/browser/navigator_connect/navigator_connect_dispatcher_host.h" | 79 #include "content/browser/navigator_connect/service_port_service_impl.h" |
80 #include "content/browser/notifications/notification_message_filter.h" | 80 #include "content/browser/notifications/notification_message_filter.h" |
81 #include "content/browser/permissions/permission_service_context.h" | 81 #include "content/browser/permissions/permission_service_context.h" |
82 #include "content/browser/permissions/permission_service_impl.h" | 82 #include "content/browser/permissions/permission_service_impl.h" |
83 #include "content/browser/profiler_message_filter.h" | 83 #include "content/browser/profiler_message_filter.h" |
84 #include "content/browser/push_messaging/push_messaging_message_filter.h" | 84 #include "content/browser/push_messaging/push_messaging_message_filter.h" |
85 #include "content/browser/quota_dispatcher_host.h" | 85 #include "content/browser/quota_dispatcher_host.h" |
86 #include "content/browser/renderer_host/clipboard_message_filter.h" | 86 #include "content/browser/renderer_host/clipboard_message_filter.h" |
87 #include "content/browser/renderer_host/database_message_filter.h" | 87 #include "content/browser/renderer_host/database_message_filter.h" |
88 #include "content/browser/renderer_host/file_utilities_message_filter.h" | 88 #include "content/browser/renderer_host/file_utilities_message_filter.h" |
89 #include "content/browser/renderer_host/gamepad_browser_message_filter.h" | 89 #include "content/browser/renderer_host/gamepad_browser_message_filter.h" |
(...skipping 833 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
923 if (browser_command_line.HasSwitch(switches::kEnableMemoryBenchmarking)) | 923 if (browser_command_line.HasSwitch(switches::kEnableMemoryBenchmarking)) |
924 AddFilter(new MemoryBenchmarkMessageFilter()); | 924 AddFilter(new MemoryBenchmarkMessageFilter()); |
925 #endif | 925 #endif |
926 AddFilter(new PushMessagingMessageFilter( | 926 AddFilter(new PushMessagingMessageFilter( |
927 GetID(), storage_partition_impl_->GetServiceWorkerContext())); | 927 GetID(), storage_partition_impl_->GetServiceWorkerContext())); |
928 #if defined(OS_ANDROID) | 928 #if defined(OS_ANDROID) |
929 AddFilter(new ScreenOrientationMessageFilterAndroid()); | 929 AddFilter(new ScreenOrientationMessageFilterAndroid()); |
930 #endif | 930 #endif |
931 AddFilter(new GeofencingDispatcherHost( | 931 AddFilter(new GeofencingDispatcherHost( |
932 storage_partition_impl_->GetGeofencingManager())); | 932 storage_partition_impl_->GetGeofencingManager())); |
933 AddFilter(new NavigatorConnectDispatcherHost( | |
934 storage_partition_impl_->GetNavigatorConnectContext(), | |
935 message_port_message_filter_.get())); | |
936 if (browser_command_line.HasSwitch(switches::kEnableWebBluetooth)) { | 933 if (browser_command_line.HasSwitch(switches::kEnableWebBluetooth)) { |
937 bluetooth_dispatcher_host_ = new BluetoothDispatcherHost(); | 934 bluetooth_dispatcher_host_ = new BluetoothDispatcherHost(); |
938 AddFilter(bluetooth_dispatcher_host_.get()); | 935 AddFilter(bluetooth_dispatcher_host_.get()); |
939 } | 936 } |
940 } | 937 } |
941 | 938 |
942 void RenderProcessHostImpl::RegisterMojoServices() { | 939 void RenderProcessHostImpl::RegisterMojoServices() { |
943 mojo_application_host_->service_registry()->AddService( | 940 mojo_application_host_->service_registry()->AddService( |
944 base::Bind(&device::BatteryMonitorImpl::Create)); | 941 base::Bind(&device::BatteryMonitorImpl::Create)); |
945 | 942 |
946 mojo_application_host_->service_registry()->AddService( | 943 mojo_application_host_->service_registry()->AddService( |
947 base::Bind(&device::VibrationManagerImpl::Create)); | 944 base::Bind(&device::VibrationManagerImpl::Create)); |
948 | 945 |
949 mojo_application_host_->service_registry()->AddService( | 946 mojo_application_host_->service_registry()->AddService( |
950 base::Bind(&PermissionServiceContext::CreateService, | 947 base::Bind(&PermissionServiceContext::CreateService, |
951 base::Unretained(permission_service_context_.get()))); | 948 base::Unretained(permission_service_context_.get()))); |
952 | 949 |
953 mojo_application_host_->service_registry()->AddService(base::Bind( | 950 mojo_application_host_->service_registry()->AddService(base::Bind( |
954 &content::BackgroundSyncServiceImpl::Create, | 951 &content::BackgroundSyncServiceImpl::Create, |
955 base::Unretained(storage_partition_impl_->GetBackgroundSyncContext()))); | 952 base::Unretained(storage_partition_impl_->GetBackgroundSyncContext()))); |
956 | 953 |
| 954 mojo_application_host_->service_registry()->AddService(base::Bind( |
| 955 &content::ServicePortServiceImpl::Create, |
| 956 make_scoped_refptr(storage_partition_impl_->GetNavigatorConnectContext()), |
| 957 message_port_message_filter_)); |
| 958 |
957 #if defined(OS_ANDROID) | 959 #if defined(OS_ANDROID) |
958 ServiceRegistrarAndroid::RegisterProcessHostServices( | 960 ServiceRegistrarAndroid::RegisterProcessHostServices( |
959 mojo_application_host_->service_registry_android()); | 961 mojo_application_host_->service_registry_android()); |
960 #endif | 962 #endif |
961 | 963 |
962 GetContentClient()->browser()->OverrideRenderProcessMojoServices( | 964 GetContentClient()->browser()->OverrideRenderProcessMojoServices( |
963 mojo_application_host_->service_registry()); | 965 mojo_application_host_->service_registry()); |
964 } | 966 } |
965 | 967 |
966 int RenderProcessHostImpl::GetNextRoutingID() { | 968 int RenderProcessHostImpl::GetNextRoutingID() { |
(...skipping 1545 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2512 void RenderProcessHostImpl::GetAudioOutputControllers( | 2514 void RenderProcessHostImpl::GetAudioOutputControllers( |
2513 const GetAudioOutputControllersCallback& callback) const { | 2515 const GetAudioOutputControllersCallback& callback) const { |
2514 audio_renderer_host()->GetOutputControllers(callback); | 2516 audio_renderer_host()->GetOutputControllers(callback); |
2515 } | 2517 } |
2516 | 2518 |
2517 BluetoothDispatcherHost* RenderProcessHostImpl::GetBluetoothDispatcherHost() { | 2519 BluetoothDispatcherHost* RenderProcessHostImpl::GetBluetoothDispatcherHost() { |
2518 return bluetooth_dispatcher_host_.get(); | 2520 return bluetooth_dispatcher_host_.get(); |
2519 } | 2521 } |
2520 | 2522 |
2521 } // namespace content | 2523 } // namespace content |
OLD | NEW |