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 923 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
934 AddFilter(new DeviceMotionMessageFilter()); | 934 AddFilter(new DeviceMotionMessageFilter()); |
935 AddFilter(new DeviceOrientationMessageFilter()); | 935 AddFilter(new DeviceOrientationMessageFilter()); |
936 AddFilter(new ProfilerMessageFilter(PROCESS_TYPE_RENDERER)); | 936 AddFilter(new ProfilerMessageFilter(PROCESS_TYPE_RENDERER)); |
937 AddFilter(new HistogramMessageFilter()); | 937 AddFilter(new HistogramMessageFilter()); |
938 #if defined(USE_TCMALLOC) && (defined(OS_LINUX) || defined(OS_ANDROID)) | 938 #if defined(USE_TCMALLOC) && (defined(OS_LINUX) || defined(OS_ANDROID)) |
939 if (browser_command_line.HasSwitch(switches::kEnableMemoryBenchmarking)) | 939 if (browser_command_line.HasSwitch(switches::kEnableMemoryBenchmarking)) |
940 AddFilter(new MemoryBenchmarkMessageFilter()); | 940 AddFilter(new MemoryBenchmarkMessageFilter()); |
941 #endif | 941 #endif |
942 AddFilter(new PushMessagingMessageFilter( | 942 AddFilter(new PushMessagingMessageFilter( |
943 GetID(), storage_partition_impl_->GetServiceWorkerContext())); | 943 GetID(), storage_partition_impl_->GetServiceWorkerContext())); |
944 #if defined(OS_ANDROID) | 944 #if defined(OS_ANDROID) && !defined(USE_AURA) |
945 AddFilter(new ScreenOrientationMessageFilterAndroid()); | 945 AddFilter(new ScreenOrientationMessageFilterAndroid()); |
946 #endif | 946 #endif |
947 AddFilter(new GeofencingDispatcherHost( | 947 AddFilter(new GeofencingDispatcherHost( |
948 storage_partition_impl_->GetGeofencingManager())); | 948 storage_partition_impl_->GetGeofencingManager())); |
949 if (browser_command_line.HasSwitch(switches::kEnableWebBluetooth)) { | 949 if (browser_command_line.HasSwitch(switches::kEnableWebBluetooth)) { |
950 bluetooth_dispatcher_host_ = new BluetoothDispatcherHost(GetID()); | 950 bluetooth_dispatcher_host_ = new BluetoothDispatcherHost(GetID()); |
951 AddFilter(bluetooth_dispatcher_host_.get()); | 951 AddFilter(bluetooth_dispatcher_host_.get()); |
952 } | 952 } |
953 } | 953 } |
954 | 954 |
(...skipping 10 matching lines...) Expand all Loading... | |
965 | 965 |
966 mojo_application_host_->service_registry()->AddService(base::Bind( | 966 mojo_application_host_->service_registry()->AddService(base::Bind( |
967 &content::BackgroundSyncServiceImpl::Create, | 967 &content::BackgroundSyncServiceImpl::Create, |
968 base::Unretained(storage_partition_impl_->GetBackgroundSyncContext()))); | 968 base::Unretained(storage_partition_impl_->GetBackgroundSyncContext()))); |
969 | 969 |
970 mojo_application_host_->service_registry()->AddService(base::Bind( | 970 mojo_application_host_->service_registry()->AddService(base::Bind( |
971 &content::ServicePortServiceImpl::Create, | 971 &content::ServicePortServiceImpl::Create, |
972 make_scoped_refptr(storage_partition_impl_->GetNavigatorConnectContext()), | 972 make_scoped_refptr(storage_partition_impl_->GetNavigatorConnectContext()), |
973 message_port_message_filter_)); | 973 message_port_message_filter_)); |
974 | 974 |
975 #if defined(OS_ANDROID) | 975 // TODO(mfomitchev): Hopefully this is not needed... |
976 #if defined(OS_ANDROID) && !defined(USE_AURA) | |
976 ServiceRegistrarAndroid::RegisterProcessHostServices( | 977 ServiceRegistrarAndroid::RegisterProcessHostServices( |
977 mojo_application_host_->service_registry_android()); | 978 mojo_application_host_->service_registry_android()); |
978 #endif | 979 #endif |
979 | 980 |
980 GetContentClient()->browser()->RegisterRenderProcessMojoServices( | 981 GetContentClient()->browser()->RegisterRenderProcessMojoServices( |
981 mojo_application_host_->service_registry()); | 982 mojo_application_host_->service_registry()); |
982 } | 983 } |
983 | 984 |
984 int RenderProcessHostImpl::GetNextRoutingID() { | 985 int RenderProcessHostImpl::GetNextRoutingID() { |
985 return widget_helper_->GetNextRoutingID(); | 986 return widget_helper_->GetNextRoutingID(); |
(...skipping 476 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1462 if (!child_process_launcher_.get() || child_process_launcher_->IsStarting()) | 1463 if (!child_process_launcher_.get() || child_process_launcher_->IsStarting()) |
1463 return base::kNullProcessHandle; | 1464 return base::kNullProcessHandle; |
1464 | 1465 |
1465 return child_process_launcher_->GetProcess().Handle(); | 1466 return child_process_launcher_->GetProcess().Handle(); |
1466 } | 1467 } |
1467 | 1468 |
1468 bool RenderProcessHostImpl::Shutdown(int exit_code, bool wait) { | 1469 bool RenderProcessHostImpl::Shutdown(int exit_code, bool wait) { |
1469 if (run_renderer_in_process()) | 1470 if (run_renderer_in_process()) |
1470 return false; // Single process mode never shuts down the renderer. | 1471 return false; // Single process mode never shuts down the renderer. |
1471 | 1472 |
1472 #if defined(OS_ANDROID) | 1473 #if defined(OS_ANDROID) && !defined(USE_AURA) |
1473 // Android requires a different approach for killing. | 1474 // Android requires a different approach for killing. |
no sievers
2015/10/20 19:24:22
keep
| |
1474 StopChildProcess(GetHandle()); | 1475 StopChildProcess(GetHandle()); |
1475 return true; | 1476 return true; |
1476 #else | 1477 #else |
1477 if (!child_process_launcher_.get() || child_process_launcher_->IsStarting()) | 1478 if (!child_process_launcher_.get() || child_process_launcher_->IsStarting()) |
1478 return false; | 1479 return false; |
1479 | 1480 |
1480 return child_process_launcher_->GetProcess().Terminate(exit_code, wait); | 1481 return child_process_launcher_->GetProcess().Terminate(exit_code, wait); |
1481 #endif | 1482 #endif |
1482 } | 1483 } |
1483 | 1484 |
(...skipping 1042 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2526 void RenderProcessHostImpl::GetAudioOutputControllers( | 2527 void RenderProcessHostImpl::GetAudioOutputControllers( |
2527 const GetAudioOutputControllersCallback& callback) const { | 2528 const GetAudioOutputControllersCallback& callback) const { |
2528 audio_renderer_host()->GetOutputControllers(callback); | 2529 audio_renderer_host()->GetOutputControllers(callback); |
2529 } | 2530 } |
2530 | 2531 |
2531 BluetoothDispatcherHost* RenderProcessHostImpl::GetBluetoothDispatcherHost() { | 2532 BluetoothDispatcherHost* RenderProcessHostImpl::GetBluetoothDispatcherHost() { |
2532 return bluetooth_dispatcher_host_.get(); | 2533 return bluetooth_dispatcher_host_.get(); |
2533 } | 2534 } |
2534 | 2535 |
2535 } // namespace content | 2536 } // namespace content |
OLD | NEW |