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 920 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
931 AddFilter(new DeviceOrientationMessageFilter()); | 931 AddFilter(new DeviceOrientationMessageFilter()); |
932 AddFilter(new ProfilerMessageFilter(PROCESS_TYPE_RENDERER)); | 932 AddFilter(new ProfilerMessageFilter(PROCESS_TYPE_RENDERER)); |
933 AddFilter(new HistogramMessageFilter()); | 933 AddFilter(new HistogramMessageFilter()); |
934 #if defined(USE_TCMALLOC) && (defined(OS_LINUX) || defined(OS_ANDROID)) | 934 #if defined(USE_TCMALLOC) && (defined(OS_LINUX) || defined(OS_ANDROID)) |
935 if (browser_command_line.HasSwitch(switches::kEnableMemoryBenchmarking)) | 935 if (browser_command_line.HasSwitch(switches::kEnableMemoryBenchmarking)) |
936 AddFilter(new MemoryBenchmarkMessageFilter()); | 936 AddFilter(new MemoryBenchmarkMessageFilter()); |
937 #endif | 937 #endif |
938 AddFilter(new MemoryMessageFilter()); | 938 AddFilter(new MemoryMessageFilter()); |
939 AddFilter(new PushMessagingMessageFilter( | 939 AddFilter(new PushMessagingMessageFilter( |
940 GetID(), storage_partition_impl_->GetServiceWorkerContext())); | 940 GetID(), storage_partition_impl_->GetServiceWorkerContext())); |
941 #if defined(OS_ANDROID) | 941 #if defined(OS_ANDROID) && !defined(USE_AURA) |
no sievers
2015/10/22 20:55:41
TODO(crbug.com/546719)
mfomitchev
2015/11/02 21:51:16
Done.
| |
942 AddFilter(new ScreenOrientationMessageFilterAndroid()); | 942 AddFilter(new ScreenOrientationMessageFilterAndroid()); |
943 #endif | 943 #endif |
944 AddFilter(new GeofencingDispatcherHost( | 944 AddFilter(new GeofencingDispatcherHost( |
945 storage_partition_impl_->GetGeofencingManager())); | 945 storage_partition_impl_->GetGeofencingManager())); |
946 if (browser_command_line.HasSwitch(switches::kEnableWebBluetooth)) { | 946 if (browser_command_line.HasSwitch(switches::kEnableWebBluetooth)) { |
947 bluetooth_dispatcher_host_ = new BluetoothDispatcherHost(GetID()); | 947 bluetooth_dispatcher_host_ = new BluetoothDispatcherHost(GetID()); |
948 AddFilter(bluetooth_dispatcher_host_.get()); | 948 AddFilter(bluetooth_dispatcher_host_.get()); |
949 } | 949 } |
950 } | 950 } |
951 | 951 |
(...skipping 12 matching lines...) Expand all Loading... | |
964 | 964 |
965 mojo_application_host_->service_registry()->AddService(base::Bind( | 965 mojo_application_host_->service_registry()->AddService(base::Bind( |
966 &BackgroundSyncContextImpl::CreateService, | 966 &BackgroundSyncContextImpl::CreateService, |
967 base::Unretained(storage_partition_impl_->GetBackgroundSyncContext()))); | 967 base::Unretained(storage_partition_impl_->GetBackgroundSyncContext()))); |
968 | 968 |
969 mojo_application_host_->service_registry()->AddService(base::Bind( | 969 mojo_application_host_->service_registry()->AddService(base::Bind( |
970 &content::ServicePortServiceImpl::Create, | 970 &content::ServicePortServiceImpl::Create, |
971 make_scoped_refptr(storage_partition_impl_->GetNavigatorConnectContext()), | 971 make_scoped_refptr(storage_partition_impl_->GetNavigatorConnectContext()), |
972 message_port_message_filter_)); | 972 message_port_message_filter_)); |
973 | 973 |
974 #if defined(OS_ANDROID) | 974 // TODO(mfomitchev): Hopefully this is not needed... |
975 #if defined(OS_ANDROID) && !defined(USE_AURA) | |
975 ServiceRegistrarAndroid::RegisterProcessHostServices( | 976 ServiceRegistrarAndroid::RegisterProcessHostServices( |
no sievers
2015/10/22 20:55:41
revert
mfomitchev
2015/11/02 21:51:16
Done.
| |
976 mojo_application_host_->service_registry_android()); | 977 mojo_application_host_->service_registry_android()); |
977 #endif | 978 #endif |
978 | 979 |
979 GetContentClient()->browser()->RegisterRenderProcessMojoServices( | 980 GetContentClient()->browser()->RegisterRenderProcessMojoServices( |
980 mojo_application_host_->service_registry()); | 981 mojo_application_host_->service_registry()); |
981 } | 982 } |
982 | 983 |
983 int RenderProcessHostImpl::GetNextRoutingID() { | 984 int RenderProcessHostImpl::GetNextRoutingID() { |
984 return widget_helper_->GetNextRoutingID(); | 985 return widget_helper_->GetNextRoutingID(); |
985 } | 986 } |
(...skipping 470 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1456 bool RenderProcessHostImpl::IsReady() const { | 1457 bool RenderProcessHostImpl::IsReady() const { |
1457 // The process launch result (that sets GetHandle()) and the channel | 1458 // The process launch result (that sets GetHandle()) and the channel |
1458 // connection (that sets channel_connected_) can happen in either order. | 1459 // connection (that sets channel_connected_) can happen in either order. |
1459 return GetHandle() && channel_connected_; | 1460 return GetHandle() && channel_connected_; |
1460 } | 1461 } |
1461 | 1462 |
1462 bool RenderProcessHostImpl::Shutdown(int exit_code, bool wait) { | 1463 bool RenderProcessHostImpl::Shutdown(int exit_code, bool wait) { |
1463 if (run_renderer_in_process()) | 1464 if (run_renderer_in_process()) |
1464 return false; // Single process mode never shuts down the renderer. | 1465 return false; // Single process mode never shuts down the renderer. |
1465 | 1466 |
1466 #if defined(OS_ANDROID) | 1467 #if defined(OS_ANDROID) && !defined(USE_AURA) |
no sievers
2015/10/22 20:55:41
revert
mfomitchev
2015/11/02 21:51:16
Done.
| |
1467 // Android requires a different approach for killing. | 1468 // Android requires a different approach for killing. |
1468 StopChildProcess(GetHandle()); | 1469 StopChildProcess(GetHandle()); |
1469 return true; | 1470 return true; |
1470 #else | 1471 #else |
1471 if (!child_process_launcher_.get() || child_process_launcher_->IsStarting()) | 1472 if (!child_process_launcher_.get() || child_process_launcher_->IsStarting()) |
1472 return false; | 1473 return false; |
1473 | 1474 |
1474 return child_process_launcher_->GetProcess().Terminate(exit_code, wait); | 1475 return child_process_launcher_->GetProcess().Terminate(exit_code, wait); |
1475 #endif | 1476 #endif |
1476 } | 1477 } |
(...skipping 1052 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2529 void RenderProcessHostImpl::GetAudioOutputControllers( | 2530 void RenderProcessHostImpl::GetAudioOutputControllers( |
2530 const GetAudioOutputControllersCallback& callback) const { | 2531 const GetAudioOutputControllersCallback& callback) const { |
2531 audio_renderer_host()->GetOutputControllers(callback); | 2532 audio_renderer_host()->GetOutputControllers(callback); |
2532 } | 2533 } |
2533 | 2534 |
2534 BluetoothDispatcherHost* RenderProcessHostImpl::GetBluetoothDispatcherHost() { | 2535 BluetoothDispatcherHost* RenderProcessHostImpl::GetBluetoothDispatcherHost() { |
2535 return bluetooth_dispatcher_host_.get(); | 2536 return bluetooth_dispatcher_host_.get(); |
2536 } | 2537 } |
2537 | 2538 |
2538 } // namespace content | 2539 } // namespace content |
OLD | NEW |