| 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 #ifndef CONTENT_BROWSER_RENDERER_HOST_RENDER_PROCESS_HOST_IMPL_H_ | 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_RENDER_PROCESS_HOST_IMPL_H_ |
| 6 #define CONTENT_BROWSER_RENDERER_HOST_RENDER_PROCESS_HOST_IMPL_H_ | 6 #define CONTENT_BROWSER_RENDERER_HOST_RENDER_PROCESS_HOST_IMPL_H_ |
| 7 | 7 |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 #include <stdint.h> | 9 #include <stdint.h> |
| 10 | 10 |
| 11 #include <map> | 11 #include <map> |
| 12 #include <memory> | 12 #include <memory> |
| 13 #include <queue> | 13 #include <queue> |
| 14 #include <string> | 14 #include <string> |
| 15 | 15 |
| 16 #include "base/macros.h" | 16 #include "base/macros.h" |
| 17 #include "base/memory/ref_counted.h" | 17 #include "base/memory/ref_counted.h" |
| 18 #include "base/observer_list.h" | 18 #include "base/observer_list.h" |
| 19 #include "base/process/process.h" | 19 #include "base/process/process.h" |
| 20 #include "base/single_thread_task_runner.h" | 20 #include "base/single_thread_task_runner.h" |
| 21 #include "base/synchronization/waitable_event.h" | 21 #include "base/synchronization/waitable_event.h" |
| 22 #include "build/build_config.h" | 22 #include "build/build_config.h" |
| 23 #include "content/browser/child_process_launcher.h" | 23 #include "content/browser/child_process_launcher.h" |
| 24 #include "content/browser/dom_storage/session_storage_namespace_impl.h" | 24 #include "content/browser/dom_storage/session_storage_namespace_impl.h" |
| 25 #include "content/browser/webrtc/webrtc_eventlog_host.h" | 25 #include "content/browser/webrtc/webrtc_eventlog_host.h" |
| 26 #include "content/common/associated_interfaces.mojom.h" | 26 #include "content/common/associated_interfaces.mojom.h" |
| 27 #include "content/common/content_export.h" | 27 #include "content/common/content_export.h" |
| 28 #include "content/common/indexed_db/indexed_db.mojom.h" |
| 28 #include "content/common/renderer.mojom.h" | 29 #include "content/common/renderer.mojom.h" |
| 29 #include "content/public/browser/render_process_host.h" | 30 #include "content/public/browser/render_process_host.h" |
| 30 #include "content/public/common/service_manager_connection.h" | 31 #include "content/public/common/service_manager_connection.h" |
| 31 #include "ipc/ipc_channel_proxy.h" | 32 #include "ipc/ipc_channel_proxy.h" |
| 32 #include "ipc/ipc_platform_file.h" | 33 #include "ipc/ipc_platform_file.h" |
| 33 #include "media/media_features.h" | 34 #include "media/media_features.h" |
| 34 #include "mojo/public/cpp/bindings/associated_binding.h" | 35 #include "mojo/public/cpp/bindings/associated_binding.h" |
| 35 #include "mojo/public/cpp/bindings/associated_binding_set.h" | 36 #include "mojo/public/cpp/bindings/associated_binding_set.h" |
| 36 #include "mojo/public/cpp/bindings/interface_ptr.h" | 37 #include "mojo/public/cpp/bindings/interface_ptr.h" |
| 37 #include "services/service_manager/public/cpp/interface_registry.h" | 38 #include "services/service_manager/public/cpp/interface_registry.h" |
| (...skipping 10 matching lines...) Expand all Loading... |
| 48 class CommandLine; | 49 class CommandLine; |
| 49 class MessageLoop; | 50 class MessageLoop; |
| 50 class SharedPersistentMemoryAllocator; | 51 class SharedPersistentMemoryAllocator; |
| 51 } | 52 } |
| 52 | 53 |
| 53 namespace content { | 54 namespace content { |
| 54 class AudioInputRendererHost; | 55 class AudioInputRendererHost; |
| 55 class AudioRendererHost; | 56 class AudioRendererHost; |
| 56 class ChildConnection; | 57 class ChildConnection; |
| 57 class GpuClient; | 58 class GpuClient; |
| 59 class IndexedDBDispatcherHost; |
| 58 class InProcessChildThreadParams; | 60 class InProcessChildThreadParams; |
| 59 class MessagePortMessageFilter; | 61 class MessagePortMessageFilter; |
| 60 class NotificationMessageFilter; | 62 class NotificationMessageFilter; |
| 61 #if BUILDFLAG(ENABLE_WEBRTC) | 63 #if BUILDFLAG(ENABLE_WEBRTC) |
| 62 class P2PSocketDispatcherHost; | 64 class P2PSocketDispatcherHost; |
| 63 #endif | 65 #endif |
| 64 class PermissionServiceContext; | 66 class PermissionServiceContext; |
| 65 class PeerConnectionTrackerHost; | 67 class PeerConnectionTrackerHost; |
| 66 class RenderFrameMessageFilter; | 68 class RenderFrameMessageFilter; |
| 67 class RenderWidgetHelper; | 69 class RenderWidgetHelper; |
| (...skipping 290 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 358 // Creates a PersistentMemoryAllocator and shares it with the renderer | 360 // Creates a PersistentMemoryAllocator and shares it with the renderer |
| 359 // process for it to store histograms from that process. The allocator is | 361 // process for it to store histograms from that process. The allocator is |
| 360 // available for extraction by a SubprocesMetricsProvider in order to | 362 // available for extraction by a SubprocesMetricsProvider in order to |
| 361 // report those histograms to UMA. | 363 // report those histograms to UMA. |
| 362 void CreateSharedRendererHistogramAllocator(); | 364 void CreateSharedRendererHistogramAllocator(); |
| 363 | 365 |
| 364 // Handle termination of our process. | 366 // Handle termination of our process. |
| 365 void ProcessDied(bool already_dead, RendererClosedDetails* known_details); | 367 void ProcessDied(bool already_dead, RendererClosedDetails* known_details); |
| 366 | 368 |
| 367 void OnRouteProviderRequest(mojom::RouteProviderAssociatedRequest request); | 369 void OnRouteProviderRequest(mojom::RouteProviderAssociatedRequest request); |
| 370 void OnIndexedDBFactoryRequest( |
| 371 ::indexed_db::mojom::FactoryAssociatedRequest request); |
| 368 | 372 |
| 369 // GpuSwitchingObserver implementation. | 373 // GpuSwitchingObserver implementation. |
| 370 void OnGpuSwitched() override; | 374 void OnGpuSwitched() override; |
| 371 | 375 |
| 372 #if BUILDFLAG(ENABLE_WEBRTC) | 376 #if BUILDFLAG(ENABLE_WEBRTC) |
| 373 void OnRegisterAecDumpConsumer(int id); | 377 void OnRegisterAecDumpConsumer(int id); |
| 374 void OnUnregisterAecDumpConsumer(int id); | 378 void OnUnregisterAecDumpConsumer(int id); |
| 375 void RegisterAecDumpConsumerOnUIThread(int id); | 379 void RegisterAecDumpConsumerOnUIThread(int id); |
| 376 void UnregisterAecDumpConsumerOnUIThread(int id); | 380 void UnregisterAecDumpConsumerOnUIThread(int id); |
| 377 void EnableAecDumpForId(const base::FilePath& file, int id); | 381 void EnableAecDumpForId(const base::FilePath& file, int id); |
| (...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 557 // Records the time when the process starts surviving for workers for UMA. | 561 // Records the time when the process starts surviving for workers for UMA. |
| 558 base::TimeTicks survive_for_worker_start_time_; | 562 base::TimeTicks survive_for_worker_start_time_; |
| 559 | 563 |
| 560 // Context shared for each mojom::PermissionService instance created for this | 564 // Context shared for each mojom::PermissionService instance created for this |
| 561 // RPH. | 565 // RPH. |
| 562 std::unique_ptr<PermissionServiceContext> permission_service_context_; | 566 std::unique_ptr<PermissionServiceContext> permission_service_context_; |
| 563 | 567 |
| 564 // The memory allocator, if any, in which the renderer will write its metrics. | 568 // The memory allocator, if any, in which the renderer will write its metrics. |
| 565 std::unique_ptr<base::SharedPersistentMemoryAllocator> metrics_allocator_; | 569 std::unique_ptr<base::SharedPersistentMemoryAllocator> metrics_allocator_; |
| 566 | 570 |
| 571 scoped_refptr<IndexedDBDispatcherHost> indexed_db_factory_; |
| 572 |
| 567 bool channel_connected_; | 573 bool channel_connected_; |
| 568 bool sent_render_process_ready_; | 574 bool sent_render_process_ready_; |
| 569 | 575 |
| 570 #if defined(OS_ANDROID) | 576 #if defined(OS_ANDROID) |
| 571 // UI thread is the source of sync IPCs and all shutdown signals. | 577 // UI thread is the source of sync IPCs and all shutdown signals. |
| 572 // Therefore a proper shutdown event to unblock the UI thread is not | 578 // Therefore a proper shutdown event to unblock the UI thread is not |
| 573 // possible without massive refactoring shutdown code. | 579 // possible without massive refactoring shutdown code. |
| 574 // Luckily Android never performs a clean shutdown. So explicitly | 580 // Luckily Android never performs a clean shutdown. So explicitly |
| 575 // ignore this problem. | 581 // ignore this problem. |
| 576 base::WaitableEvent never_signaled_; | 582 base::WaitableEvent never_signaled_; |
| (...skipping 11 matching lines...) Expand all Loading... |
| 588 instance_weak_factory_; | 594 instance_weak_factory_; |
| 589 | 595 |
| 590 base::WeakPtrFactory<RenderProcessHostImpl> weak_factory_; | 596 base::WeakPtrFactory<RenderProcessHostImpl> weak_factory_; |
| 591 | 597 |
| 592 DISALLOW_COPY_AND_ASSIGN(RenderProcessHostImpl); | 598 DISALLOW_COPY_AND_ASSIGN(RenderProcessHostImpl); |
| 593 }; | 599 }; |
| 594 | 600 |
| 595 } // namespace content | 601 } // namespace content |
| 596 | 602 |
| 597 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_PROCESS_HOST_IMPL_H_ | 603 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_PROCESS_HOST_IMPL_H_ |
| OLD | NEW |