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 841 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
931 if (browser_command_line.HasSwitch(switches::kEnableMemoryBenchmarking)) | 931 if (browser_command_line.HasSwitch(switches::kEnableMemoryBenchmarking)) |
932 AddFilter(new MemoryBenchmarkMessageFilter()); | 932 AddFilter(new MemoryBenchmarkMessageFilter()); |
933 #endif | 933 #endif |
934 AddFilter(new PushMessagingMessageFilter( | 934 AddFilter(new PushMessagingMessageFilter( |
935 GetID(), storage_partition_impl_->GetServiceWorkerContext())); | 935 GetID(), storage_partition_impl_->GetServiceWorkerContext())); |
936 #if defined(OS_ANDROID) | 936 #if defined(OS_ANDROID) |
937 AddFilter(new ScreenOrientationMessageFilterAndroid()); | 937 AddFilter(new ScreenOrientationMessageFilterAndroid()); |
938 #endif | 938 #endif |
939 AddFilter(new GeofencingDispatcherHost( | 939 AddFilter(new GeofencingDispatcherHost( |
940 storage_partition_impl_->GetGeofencingManager())); | 940 storage_partition_impl_->GetGeofencingManager())); |
941 AddFilter(new NavigatorConnectDispatcherHost( | |
942 storage_partition_impl_->GetNavigatorConnectContext(), | |
943 message_port_message_filter_.get())); | |
944 if (browser_command_line.HasSwitch(switches::kEnableWebBluetooth)) { | 941 if (browser_command_line.HasSwitch(switches::kEnableWebBluetooth)) { |
945 bluetooth_dispatcher_host_ = new BluetoothDispatcherHost(); | 942 bluetooth_dispatcher_host_ = new BluetoothDispatcherHost(); |
946 AddFilter(bluetooth_dispatcher_host_.get()); | 943 AddFilter(bluetooth_dispatcher_host_.get()); |
947 } | 944 } |
948 } | 945 } |
949 | 946 |
950 void RenderProcessHostImpl::RegisterMojoServices() { | 947 void RenderProcessHostImpl::RegisterMojoServices() { |
951 mojo_application_host_->service_registry()->AddService( | 948 mojo_application_host_->service_registry()->AddService( |
952 base::Bind(&device::BatteryMonitorImpl::Create)); | 949 base::Bind(&device::BatteryMonitorImpl::Create)); |
953 | 950 |
954 mojo_application_host_->service_registry()->AddService( | 951 mojo_application_host_->service_registry()->AddService( |
955 base::Bind(&device::VibrationManagerImpl::Create)); | 952 base::Bind(&device::VibrationManagerImpl::Create)); |
956 | 953 |
957 mojo_application_host_->service_registry()->AddService( | 954 mojo_application_host_->service_registry()->AddService( |
958 base::Bind(&PermissionServiceContext::CreateService, | 955 base::Bind(&PermissionServiceContext::CreateService, |
959 base::Unretained(permission_service_context_.get()))); | 956 base::Unretained(permission_service_context_.get()))); |
960 | 957 |
961 mojo_application_host_->service_registry()->AddService(base::Bind( | 958 mojo_application_host_->service_registry()->AddService(base::Bind( |
962 &content::BackgroundSyncServiceImpl::Create, | 959 &content::BackgroundSyncServiceImpl::Create, |
963 base::Unretained(storage_partition_impl_->GetBackgroundSyncContext()))); | 960 base::Unretained(storage_partition_impl_->GetBackgroundSyncContext()))); |
964 | 961 |
| 962 mojo_application_host_->service_registry()->AddService(base::Bind( |
| 963 &content::ServicePortServiceImpl::Create, |
| 964 make_scoped_refptr(storage_partition_impl_->GetNavigatorConnectContext()), |
| 965 message_port_message_filter_)); |
| 966 |
965 #if defined(OS_ANDROID) | 967 #if defined(OS_ANDROID) |
966 ServiceRegistrarAndroid::RegisterProcessHostServices( | 968 ServiceRegistrarAndroid::RegisterProcessHostServices( |
967 mojo_application_host_->service_registry_android()); | 969 mojo_application_host_->service_registry_android()); |
968 #endif | 970 #endif |
969 | 971 |
970 GetContentClient()->browser()->OverrideRenderProcessMojoServices( | 972 GetContentClient()->browser()->OverrideRenderProcessMojoServices( |
971 mojo_application_host_->service_registry()); | 973 mojo_application_host_->service_registry()); |
972 } | 974 } |
973 | 975 |
974 int RenderProcessHostImpl::GetNextRoutingID() { | 976 int RenderProcessHostImpl::GetNextRoutingID() { |
(...skipping 1544 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2519 void RenderProcessHostImpl::GetAudioOutputControllers( | 2521 void RenderProcessHostImpl::GetAudioOutputControllers( |
2520 const GetAudioOutputControllersCallback& callback) const { | 2522 const GetAudioOutputControllersCallback& callback) const { |
2521 audio_renderer_host()->GetOutputControllers(callback); | 2523 audio_renderer_host()->GetOutputControllers(callback); |
2522 } | 2524 } |
2523 | 2525 |
2524 BluetoothDispatcherHost* RenderProcessHostImpl::GetBluetoothDispatcherHost() { | 2526 BluetoothDispatcherHost* RenderProcessHostImpl::GetBluetoothDispatcherHost() { |
2525 return bluetooth_dispatcher_host_.get(); | 2527 return bluetooth_dispatcher_host_.get(); |
2526 } | 2528 } |
2527 | 2529 |
2528 } // namespace content | 2530 } // namespace content |
OLD | NEW |