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 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
83 #include "content/browser/media/media_internals.h" | 83 #include "content/browser/media/media_internals.h" |
84 #include "content/browser/media/midi_host.h" | 84 #include "content/browser/media/midi_host.h" |
85 #include "content/browser/memory/memory_coordinator.h" | 85 #include "content/browser/memory/memory_coordinator.h" |
86 #include "content/browser/memory/memory_message_filter.h" | 86 #include "content/browser/memory/memory_message_filter.h" |
87 #include "content/browser/message_port_message_filter.h" | 87 #include "content/browser/message_port_message_filter.h" |
88 #include "content/browser/mime_registry_impl.h" | 88 #include "content/browser/mime_registry_impl.h" |
89 #include "content/browser/notifications/notification_message_filter.h" | 89 #include "content/browser/notifications/notification_message_filter.h" |
90 #include "content/browser/notifications/platform_notification_context_impl.h" | 90 #include "content/browser/notifications/platform_notification_context_impl.h" |
91 #include "content/browser/permissions/permission_service_context.h" | 91 #include "content/browser/permissions/permission_service_context.h" |
92 #include "content/browser/permissions/permission_service_impl.h" | 92 #include "content/browser/permissions/permission_service_impl.h" |
| 93 #include "content/browser/power_monitor_message_broadcaster.h" |
93 #include "content/browser/profiler_message_filter.h" | 94 #include "content/browser/profiler_message_filter.h" |
94 #include "content/browser/push_messaging/push_messaging_message_filter.h" | 95 #include "content/browser/push_messaging/push_messaging_message_filter.h" |
95 #include "content/browser/quota_dispatcher_host.h" | 96 #include "content/browser/quota_dispatcher_host.h" |
96 #include "content/browser/renderer_host/clipboard_message_filter.h" | 97 #include "content/browser/renderer_host/clipboard_message_filter.h" |
97 #include "content/browser/renderer_host/database_message_filter.h" | 98 #include "content/browser/renderer_host/database_message_filter.h" |
98 #include "content/browser/renderer_host/file_utilities_message_filter.h" | 99 #include "content/browser/renderer_host/file_utilities_message_filter.h" |
99 #include "content/browser/renderer_host/gamepad_browser_message_filter.h" | 100 #include "content/browser/renderer_host/gamepad_browser_message_filter.h" |
100 #include "content/browser/renderer_host/media/audio_input_renderer_host.h" | 101 #include "content/browser/renderer_host/media/audio_input_renderer_host.h" |
101 #include "content/browser/renderer_host/media/audio_renderer_host.h" | 102 #include "content/browser/renderer_host/media/audio_renderer_host.h" |
102 #include "content/browser/renderer_host/media/media_stream_dispatcher_host.h" | 103 #include "content/browser/renderer_host/media/media_stream_dispatcher_host.h" |
(...skipping 572 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
675 is_process_backgrounded_(false), | 676 is_process_backgrounded_(false), |
676 id_(ChildProcessHostImpl::GenerateChildProcessUniqueId()), | 677 id_(ChildProcessHostImpl::GenerateChildProcessUniqueId()), |
677 browser_context_(browser_context), | 678 browser_context_(browser_context), |
678 storage_partition_impl_(storage_partition_impl), | 679 storage_partition_impl_(storage_partition_impl), |
679 sudden_termination_allowed_(true), | 680 sudden_termination_allowed_(true), |
680 ignore_input_events_(false), | 681 ignore_input_events_(false), |
681 is_for_guests_only_(is_for_guests_only), | 682 is_for_guests_only_(is_for_guests_only), |
682 gpu_observer_registered_(false), | 683 gpu_observer_registered_(false), |
683 delayed_cleanup_needed_(false), | 684 delayed_cleanup_needed_(false), |
684 within_process_died_observer_(false), | 685 within_process_died_observer_(false), |
685 power_monitor_broadcaster_(this), | |
686 #if defined(ENABLE_WEBRTC) | 686 #if defined(ENABLE_WEBRTC) |
687 webrtc_eventlog_host_(id_), | 687 webrtc_eventlog_host_(id_), |
688 #endif | 688 #endif |
689 max_worker_count_(0), | 689 max_worker_count_(0), |
690 permission_service_context_(new PermissionServiceContext(this)), | 690 permission_service_context_(new PermissionServiceContext(this)), |
691 channel_connected_(false), | 691 channel_connected_(false), |
692 sent_render_process_ready_(false), | 692 sent_render_process_ready_(false), |
693 #if defined(OS_ANDROID) | 693 #if defined(OS_ANDROID) |
694 never_signaled_(base::WaitableEvent::ResetPolicy::MANUAL, | 694 never_signaled_(base::WaitableEvent::ResetPolicy::MANUAL, |
695 base::WaitableEvent::InitialState::NOT_SIGNALED), | 695 base::WaitableEvent::InitialState::NOT_SIGNALED), |
(...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
897 channel_->Pause(); | 897 channel_->Pause(); |
898 | 898 |
899 fast_shutdown_started_ = false; | 899 fast_shutdown_started_ = false; |
900 } | 900 } |
901 | 901 |
902 if (!gpu_observer_registered_) { | 902 if (!gpu_observer_registered_) { |
903 gpu_observer_registered_ = true; | 903 gpu_observer_registered_ = true; |
904 ui::GpuSwitchingManager::GetInstance()->AddObserver(this); | 904 ui::GpuSwitchingManager::GetInstance()->AddObserver(this); |
905 } | 905 } |
906 | 906 |
907 power_monitor_broadcaster_.Init(); | |
908 | |
909 is_initialized_ = true; | 907 is_initialized_ = true; |
910 init_time_ = base::TimeTicks::Now(); | 908 init_time_ = base::TimeTicks::Now(); |
911 return true; | 909 return true; |
912 } | 910 } |
913 | 911 |
914 void RenderProcessHostImpl::EnableSendQueue() { | 912 void RenderProcessHostImpl::EnableSendQueue() { |
915 if (!channel_) | 913 if (!channel_) |
916 InitializeChannelProxy(); | 914 InitializeChannelProxy(); |
917 } | 915 } |
918 | 916 |
(...skipping 329 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1248 // BrowserMainLoop, which owns TimeZoneMonitor, is alive for the lifetime of | 1246 // BrowserMainLoop, which owns TimeZoneMonitor, is alive for the lifetime of |
1249 // Mojo communication (see BrowserMainLoop::ShutdownThreadsAndCleanUp(), | 1247 // Mojo communication (see BrowserMainLoop::ShutdownThreadsAndCleanUp(), |
1250 // which shuts down Mojo). Hence, passing that TimeZoneMonitor instance as | 1248 // which shuts down Mojo). Hence, passing that TimeZoneMonitor instance as |
1251 // a raw pointer here is safe. | 1249 // a raw pointer here is safe. |
1252 AddUIThreadInterface( | 1250 AddUIThreadInterface( |
1253 registry.get(), | 1251 registry.get(), |
1254 base::Bind(&device::TimeZoneMonitor::Bind, | 1252 base::Bind(&device::TimeZoneMonitor::Bind, |
1255 base::Unretained( | 1253 base::Unretained( |
1256 BrowserMainLoop::GetInstance()->time_zone_monitor()))); | 1254 BrowserMainLoop::GetInstance()->time_zone_monitor()))); |
1257 | 1255 |
| 1256 AddUIThreadInterface(registry.get(), |
| 1257 base::Bind(&PowerMonitorMessageBroadcaster::Create)); |
| 1258 |
1258 scoped_refptr<base::SingleThreadTaskRunner> file_task_runner = | 1259 scoped_refptr<base::SingleThreadTaskRunner> file_task_runner = |
1259 BrowserThread::GetTaskRunnerForThread(BrowserThread::FILE); | 1260 BrowserThread::GetTaskRunnerForThread(BrowserThread::FILE); |
1260 registry->AddInterface(base::Bind(&MimeRegistryImpl::Create), | 1261 registry->AddInterface(base::Bind(&MimeRegistryImpl::Create), |
1261 file_task_runner); | 1262 file_task_runner); |
1262 #if defined(USE_MINIKIN_HYPHENATION) | 1263 #if defined(USE_MINIKIN_HYPHENATION) |
1263 registry->AddInterface(base::Bind(&hyphenation::HyphenationImpl::Create), | 1264 registry->AddInterface(base::Bind(&hyphenation::HyphenationImpl::Create), |
1264 file_task_runner); | 1265 file_task_runner); |
1265 #endif | 1266 #endif |
1266 | 1267 |
1267 // These callbacks will be run immediately on the IO thread. | 1268 // These callbacks will be run immediately on the IO thread. |
(...skipping 1715 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2983 bad_message::ReceivedBadMessage(render_process_id, | 2984 bad_message::ReceivedBadMessage(render_process_id, |
2984 bad_message::RPH_MOJO_PROCESS_ERROR); | 2985 bad_message::RPH_MOJO_PROCESS_ERROR); |
2985 } | 2986 } |
2986 | 2987 |
2987 void RenderProcessHostImpl::CreateURLLoaderFactory( | 2988 void RenderProcessHostImpl::CreateURLLoaderFactory( |
2988 mojo::InterfaceRequest<mojom::URLLoaderFactory> request) { | 2989 mojo::InterfaceRequest<mojom::URLLoaderFactory> request) { |
2989 URLLoaderFactoryImpl::Create(resource_message_filter_, std::move(request)); | 2990 URLLoaderFactoryImpl::Create(resource_message_filter_, std::move(request)); |
2990 } | 2991 } |
2991 | 2992 |
2992 } // namespace content | 2993 } // namespace content |
OLD | NEW |