| 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/renderer_host/offscreen_canvas_compositor_frame_sink_p
rovider_impl.h" | |
| 26 #include "content/browser/webrtc/webrtc_eventlog_host.h" | 25 #include "content/browser/webrtc/webrtc_eventlog_host.h" |
| 27 #include "content/common/associated_interfaces.mojom.h" | 26 #include "content/common/associated_interfaces.mojom.h" |
| 28 #include "content/common/content_export.h" | 27 #include "content/common/content_export.h" |
| 29 #include "content/common/indexed_db/indexed_db.mojom.h" | 28 #include "content/common/indexed_db/indexed_db.mojom.h" |
| 30 #include "content/common/renderer.mojom.h" | 29 #include "content/common/renderer.mojom.h" |
| 31 #include "content/public/browser/render_process_host.h" | 30 #include "content/public/browser/render_process_host.h" |
| 32 #include "content/public/common/service_manager_connection.h" | 31 #include "content/public/common/service_manager_connection.h" |
| 33 #include "ipc/ipc_channel_proxy.h" | 32 #include "ipc/ipc_channel_proxy.h" |
| 34 #include "ipc/ipc_platform_file.h" | 33 #include "ipc/ipc_platform_file.h" |
| 35 #include "media/media_features.h" | 34 #include "media/media_features.h" |
| 36 #include "mojo/edk/embedder/pending_process_connection.h" | 35 #include "mojo/edk/embedder/pending_process_connection.h" |
| 37 #include "mojo/public/cpp/bindings/associated_binding.h" | 36 #include "mojo/public/cpp/bindings/associated_binding.h" |
| 38 #include "mojo/public/cpp/bindings/associated_binding_set.h" | 37 #include "mojo/public/cpp/bindings/associated_binding_set.h" |
| 39 #include "mojo/public/cpp/bindings/interface_ptr.h" | 38 #include "mojo/public/cpp/bindings/interface_ptr.h" |
| 40 #include "services/service_manager/public/cpp/interface_registry.h" | 39 #include "services/service_manager/public/cpp/interface_registry.h" |
| 41 #include "services/service_manager/public/interfaces/service.mojom.h" | 40 #include "services/service_manager/public/interfaces/service.mojom.h" |
| 42 #include "services/ui/public/interfaces/gpu.mojom.h" | 41 #include "services/ui/public/interfaces/gpu.mojom.h" |
| 42 #include "services/ui/surfaces/display_compositor.h" |
| 43 #include "ui/gfx/gpu_memory_buffer.h" | 43 #include "ui/gfx/gpu_memory_buffer.h" |
| 44 #include "ui/gl/gpu_switching_observer.h" | 44 #include "ui/gl/gpu_switching_observer.h" |
| 45 | 45 |
| 46 #if defined(OS_ANDROID) | 46 #if defined(OS_ANDROID) |
| 47 #include "content/browser/android/synchronous_compositor_browser_filter.h" | 47 #include "content/browser/android/synchronous_compositor_browser_filter.h" |
| 48 #endif | 48 #endif |
| 49 | 49 |
| 50 namespace base { | 50 namespace base { |
| 51 class CommandLine; | 51 class CommandLine; |
| 52 class MessageLoop; | 52 class MessageLoop; |
| (...skipping 285 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 338 int32_t routing_id, | 338 int32_t routing_id, |
| 339 mojom::AssociatedInterfaceProviderAssociatedRequest request) override; | 339 mojom::AssociatedInterfaceProviderAssociatedRequest request) override; |
| 340 | 340 |
| 341 // mojom::AssociatedInterfaceProvider: | 341 // mojom::AssociatedInterfaceProvider: |
| 342 void GetAssociatedInterface( | 342 void GetAssociatedInterface( |
| 343 const std::string& name, | 343 const std::string& name, |
| 344 mojom::AssociatedInterfaceAssociatedRequest request) override; | 344 mojom::AssociatedInterfaceAssociatedRequest request) override; |
| 345 | 345 |
| 346 void CreateMusGpuRequest(ui::mojom::GpuRequest request); | 346 void CreateMusGpuRequest(ui::mojom::GpuRequest request); |
| 347 void CreateOffscreenCanvasCompositorFrameSinkProvider( | 347 void CreateOffscreenCanvasCompositorFrameSinkProvider( |
| 348 blink::mojom::OffscreenCanvasCompositorFrameSinkProviderRequest request); | 348 cc::mojom::DisplayCompositorRequest request); |
| 349 void CreateStoragePartitionService( | 349 void CreateStoragePartitionService( |
| 350 mojo::InterfaceRequest<mojom::StoragePartitionService> request); | 350 mojo::InterfaceRequest<mojom::StoragePartitionService> request); |
| 351 | 351 |
| 352 // Control message handlers. | 352 // Control message handlers. |
| 353 void OnShutdownRequest(); | 353 void OnShutdownRequest(); |
| 354 void SuddenTerminationChanged(bool enabled); | 354 void SuddenTerminationChanged(bool enabled); |
| 355 void OnUserMetricsRecordAction(const std::string& action); | 355 void OnUserMetricsRecordAction(const std::string& action); |
| 356 void OnCloseACK(int old_route_id); | 356 void OnCloseACK(int old_route_id); |
| 357 | 357 |
| 358 // Generates a command line to be used to spawn a renderer and appends the | 358 // Generates a command line to be used to spawn a renderer and appends the |
| (...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 592 // Therefore a proper shutdown event to unblock the UI thread is not | 592 // Therefore a proper shutdown event to unblock the UI thread is not |
| 593 // possible without massive refactoring shutdown code. | 593 // possible without massive refactoring shutdown code. |
| 594 // Luckily Android never performs a clean shutdown. So explicitly | 594 // Luckily Android never performs a clean shutdown. So explicitly |
| 595 // ignore this problem. | 595 // ignore this problem. |
| 596 base::WaitableEvent never_signaled_; | 596 base::WaitableEvent never_signaled_; |
| 597 #endif | 597 #endif |
| 598 | 598 |
| 599 scoped_refptr<ResourceMessageFilter> resource_message_filter_; | 599 scoped_refptr<ResourceMessageFilter> resource_message_filter_; |
| 600 std::unique_ptr<GpuClient, BrowserThread::DeleteOnIOThread> gpu_client_; | 600 std::unique_ptr<GpuClient, BrowserThread::DeleteOnIOThread> gpu_client_; |
| 601 | 601 |
| 602 std::unique_ptr<OffscreenCanvasCompositorFrameSinkProviderImpl> | 602 std::unique_ptr<ui::DisplayCompositor> display_compositor_; |
| 603 offscreen_canvas_provider_; | |
| 604 | 603 |
| 605 mojom::RouteProviderAssociatedPtr remote_route_provider_; | 604 mojom::RouteProviderAssociatedPtr remote_route_provider_; |
| 606 mojom::RendererAssociatedPtr renderer_interface_; | 605 mojom::RendererAssociatedPtr renderer_interface_; |
| 607 | 606 |
| 608 // Tracks active audio streams within the render process; used to determine if | 607 // Tracks active audio streams within the render process; used to determine if |
| 609 // if a process should be backgrounded. | 608 // if a process should be backgrounded. |
| 610 int audio_stream_count_ = 0; | 609 int audio_stream_count_ = 0; |
| 611 | 610 |
| 612 // A WeakPtrFactory which is reset every time Cleanup() runs. Used to vend | 611 // A WeakPtrFactory which is reset every time Cleanup() runs. Used to vend |
| 613 // WeakPtrs which are invalidated any time the RPHI is recycled. | 612 // WeakPtrs which are invalidated any time the RPHI is recycled. |
| 614 std::unique_ptr<base::WeakPtrFactory<RenderProcessHostImpl>> | 613 std::unique_ptr<base::WeakPtrFactory<RenderProcessHostImpl>> |
| 615 instance_weak_factory_; | 614 instance_weak_factory_; |
| 616 | 615 |
| 617 base::WeakPtrFactory<RenderProcessHostImpl> weak_factory_; | 616 base::WeakPtrFactory<RenderProcessHostImpl> weak_factory_; |
| 618 | 617 |
| 619 DISALLOW_COPY_AND_ASSIGN(RenderProcessHostImpl); | 618 DISALLOW_COPY_AND_ASSIGN(RenderProcessHostImpl); |
| 620 }; | 619 }; |
| 621 | 620 |
| 622 } // namespace content | 621 } // namespace content |
| 623 | 622 |
| 624 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_PROCESS_HOST_IMPL_H_ | 623 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_PROCESS_HOST_IMPL_H_ |
| OLD | NEW |