OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
59 #include "content/browser/indexed_db/indexed_db_dispatcher_host.h" | 59 #include "content/browser/indexed_db/indexed_db_dispatcher_host.h" |
60 #include "content/browser/loader/resource_message_filter.h" | 60 #include "content/browser/loader/resource_message_filter.h" |
61 #include "content/browser/loader/resource_scheduler_filter.h" | 61 #include "content/browser/loader/resource_scheduler_filter.h" |
62 #include "content/browser/media/capture/audio_mirroring_manager.h" | 62 #include "content/browser/media/capture/audio_mirroring_manager.h" |
63 #include "content/browser/media/media_internals.h" | 63 #include "content/browser/media/media_internals.h" |
64 #include "content/browser/media/midi_host.h" | 64 #include "content/browser/media/midi_host.h" |
65 #include "content/browser/message_port_message_filter.h" | 65 #include "content/browser/message_port_message_filter.h" |
66 #include "content/browser/mime_registry_message_filter.h" | 66 #include "content/browser/mime_registry_message_filter.h" |
67 #include "content/browser/mojo/mojo_application_host.h" | 67 #include "content/browser/mojo/mojo_application_host.h" |
68 #include "content/browser/notifications/notification_message_filter.h" | 68 #include "content/browser/notifications/notification_message_filter.h" |
| 69 #include "content/browser/permissions/permission_service_context.h" |
| 70 #include "content/browser/permissions/permission_service_impl.h" |
69 #include "content/browser/profiler_message_filter.h" | 71 #include "content/browser/profiler_message_filter.h" |
70 #include "content/browser/push_messaging/push_messaging_message_filter.h" | 72 #include "content/browser/push_messaging/push_messaging_message_filter.h" |
71 #include "content/browser/quota_dispatcher_host.h" | 73 #include "content/browser/quota_dispatcher_host.h" |
72 #include "content/browser/renderer_host/clipboard_message_filter.h" | 74 #include "content/browser/renderer_host/clipboard_message_filter.h" |
73 #include "content/browser/renderer_host/database_message_filter.h" | 75 #include "content/browser/renderer_host/database_message_filter.h" |
74 #include "content/browser/renderer_host/file_utilities_message_filter.h" | 76 #include "content/browser/renderer_host/file_utilities_message_filter.h" |
75 #include "content/browser/renderer_host/gamepad_browser_message_filter.h" | 77 #include "content/browser/renderer_host/gamepad_browser_message_filter.h" |
76 #include "content/browser/renderer_host/gpu_message_filter.h" | 78 #include "content/browser/renderer_host/gpu_message_filter.h" |
77 #include "content/browser/renderer_host/media/audio_input_renderer_host.h" | 79 #include "content/browser/renderer_host/media/audio_input_renderer_host.h" |
78 #include "content/browser/renderer_host/media/audio_renderer_host.h" | 80 #include "content/browser/renderer_host/media/audio_renderer_host.h" |
(...skipping 362 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
441 browser_context_(browser_context), | 443 browser_context_(browser_context), |
442 storage_partition_impl_(storage_partition_impl), | 444 storage_partition_impl_(storage_partition_impl), |
443 sudden_termination_allowed_(true), | 445 sudden_termination_allowed_(true), |
444 ignore_input_events_(false), | 446 ignore_input_events_(false), |
445 is_isolated_guest_(is_isolated_guest), | 447 is_isolated_guest_(is_isolated_guest), |
446 gpu_observer_registered_(false), | 448 gpu_observer_registered_(false), |
447 delayed_cleanup_needed_(false), | 449 delayed_cleanup_needed_(false), |
448 within_process_died_observer_(false), | 450 within_process_died_observer_(false), |
449 power_monitor_broadcaster_(this), | 451 power_monitor_broadcaster_(this), |
450 worker_ref_count_(0), | 452 worker_ref_count_(0), |
| 453 permission_service_context_(new PermissionServiceContext(nullptr)), |
451 weak_factory_(this) { | 454 weak_factory_(this) { |
452 widget_helper_ = new RenderWidgetHelper(); | 455 widget_helper_ = new RenderWidgetHelper(); |
453 | 456 |
454 ChildProcessSecurityPolicyImpl::GetInstance()->Add(GetID()); | 457 ChildProcessSecurityPolicyImpl::GetInstance()->Add(GetID()); |
455 | 458 |
456 CHECK(!g_exited_main_message_loop); | 459 CHECK(!g_exited_main_message_loop); |
457 RegisterHost(GetID(), this); | 460 RegisterHost(GetID(), this); |
458 g_all_hosts.Get().set_check_on_null_data(true); | 461 g_all_hosts.Get().set_check_on_null_data(true); |
459 // Initialize |child_process_activity_time_| to a reasonable value. | 462 // Initialize |child_process_activity_time_| to a reasonable value. |
460 mark_child_process_activity_time(); | 463 mark_child_process_activity_time(); |
(...skipping 408 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
869 #if defined(OS_ANDROID) | 872 #if defined(OS_ANDROID) |
870 AddFilter(new ScreenOrientationMessageFilterAndroid()); | 873 AddFilter(new ScreenOrientationMessageFilterAndroid()); |
871 #endif | 874 #endif |
872 AddFilter(new GeofencingDispatcherHost( | 875 AddFilter(new GeofencingDispatcherHost( |
873 storage_partition_impl_->GetGeofencingManager())); | 876 storage_partition_impl_->GetGeofencingManager())); |
874 } | 877 } |
875 | 878 |
876 void RenderProcessHostImpl::RegisterMojoServices() { | 879 void RenderProcessHostImpl::RegisterMojoServices() { |
877 mojo_application_host_->service_registry()->AddService( | 880 mojo_application_host_->service_registry()->AddService( |
878 base::Bind(&device::BatteryMonitorImpl::Create)); | 881 base::Bind(&device::BatteryMonitorImpl::Create)); |
| 882 |
| 883 mojo_application_host_->service_registry()->AddService( |
| 884 base::Bind(&PermissionServiceContext::CreateService, |
| 885 base::Unretained(permission_service_context_.get()))); |
879 } | 886 } |
880 | 887 |
881 int RenderProcessHostImpl::GetNextRoutingID() { | 888 int RenderProcessHostImpl::GetNextRoutingID() { |
882 return widget_helper_->GetNextRoutingID(); | 889 return widget_helper_->GetNextRoutingID(); |
883 } | 890 } |
884 | 891 |
885 void RenderProcessHostImpl::ResumeDeferredNavigation( | 892 void RenderProcessHostImpl::ResumeDeferredNavigation( |
886 const GlobalRequestID& request_id) { | 893 const GlobalRequestID& request_id) { |
887 widget_helper_->ResumeDeferredNavigation(request_id); | 894 widget_helper_->ResumeDeferredNavigation(request_id); |
888 } | 895 } |
(...skipping 1349 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2238 | 2245 |
2239 void RenderProcessHostImpl::DecrementWorkerRefCount() { | 2246 void RenderProcessHostImpl::DecrementWorkerRefCount() { |
2240 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 2247 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
2241 DCHECK_GT(worker_ref_count_, 0); | 2248 DCHECK_GT(worker_ref_count_, 0); |
2242 --worker_ref_count_; | 2249 --worker_ref_count_; |
2243 if (worker_ref_count_ == 0) | 2250 if (worker_ref_count_ == 0) |
2244 Cleanup(); | 2251 Cleanup(); |
2245 } | 2252 } |
2246 | 2253 |
2247 } // namespace content | 2254 } // namespace content |
OLD | NEW |