| 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_RENDERER_RENDER_THREAD_IMPL_H_ | 5 #ifndef CONTENT_RENDERER_RENDER_THREAD_IMPL_H_ |
| 6 #define CONTENT_RENDERER_RENDER_THREAD_IMPL_H_ | 6 #define CONTENT_RENDERER_RENDER_THREAD_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 <memory> | 12 #include <memory> |
| 12 #include <set> | 13 #include <set> |
| 13 #include <string> | 14 #include <string> |
| 15 #include <utility> |
| 14 #include <vector> | 16 #include <vector> |
| 15 | 17 |
| 16 #include "base/cancelable_callback.h" | 18 #include "base/cancelable_callback.h" |
| 17 #include "base/macros.h" | 19 #include "base/macros.h" |
| 18 #include "base/memory/memory_coordinator_client.h" | 20 #include "base/memory/memory_coordinator_client.h" |
| 19 #include "base/memory/memory_pressure_listener.h" | 21 #include "base/memory/memory_pressure_listener.h" |
| 20 #include "base/memory/ref_counted.h" | 22 #include "base/memory/ref_counted.h" |
| 21 #include "base/metrics/field_trial.h" | 23 #include "base/metrics/field_trial.h" |
| 22 #include "base/metrics/user_metrics_action.h" | 24 #include "base/metrics/user_metrics_action.h" |
| 23 #include "base/observer_list.h" | 25 #include "base/observer_list.h" |
| 26 #include "base/optional.h" |
| 24 #include "base/strings/string16.h" | 27 #include "base/strings/string16.h" |
| 25 #include "base/threading/thread_checker.h" | 28 #include "base/threading/thread_checker.h" |
| 26 #include "base/timer/timer.h" | 29 #include "base/timer/timer.h" |
| 27 #include "build/build_config.h" | 30 #include "build/build_config.h" |
| 28 #include "components/variations/child_process_field_trial_syncer.h" | 31 #include "components/variations/child_process_field_trial_syncer.h" |
| 29 #include "content/child/child_thread_impl.h" | 32 #include "content/child/child_thread_impl.h" |
| 30 #include "content/child/memory/child_memory_coordinator_impl.h" | 33 #include "content/child/memory/child_memory_coordinator_impl.h" |
| 31 #include "content/common/associated_interface_registry_impl.h" | 34 #include "content/common/associated_interface_registry_impl.h" |
| 32 #include "content/common/content_export.h" | 35 #include "content/common/content_export.h" |
| 33 #include "content/common/frame.mojom.h" | 36 #include "content/common/frame.mojom.h" |
| 34 #include "content/common/frame_replication_state.h" | 37 #include "content/common/frame_replication_state.h" |
| 35 #include "content/common/frame_sink_provider.mojom.h" | 38 #include "content/common/frame_sink_provider.mojom.h" |
| 36 #include "content/common/render_frame_message_filter.mojom.h" | 39 #include "content/common/render_frame_message_filter.mojom.h" |
| 37 #include "content/common/render_message_filter.mojom.h" | 40 #include "content/common/render_message_filter.mojom.h" |
| 38 #include "content/common/renderer.mojom.h" | 41 #include "content/common/renderer.mojom.h" |
| 39 #include "content/common/storage_partition_service.mojom.h" | 42 #include "content/common/storage_partition_service.mojom.h" |
| 40 #include "content/public/renderer/render_thread.h" | 43 #include "content/public/renderer/render_thread.h" |
| 41 #include "content/renderer/gpu/compositor_dependencies.h" | 44 #include "content/renderer/gpu/compositor_dependencies.h" |
| 42 #include "content/renderer/layout_test_dependencies.h" | 45 #include "content/renderer/layout_test_dependencies.h" |
| 46 #include "content/renderer/media/audio_ipc_factory.h" |
| 43 #include "gpu/ipc/client/gpu_channel_host.h" | 47 #include "gpu/ipc/client/gpu_channel_host.h" |
| 44 #include "media/media_features.h" | 48 #include "media/media_features.h" |
| 45 #include "mojo/public/cpp/bindings/associated_binding.h" | 49 #include "mojo/public/cpp/bindings/associated_binding.h" |
| 46 #include "mojo/public/cpp/bindings/binding.h" | 50 #include "mojo/public/cpp/bindings/binding.h" |
| 47 #include "mojo/public/cpp/bindings/thread_safe_interface_ptr.h" | 51 #include "mojo/public/cpp/bindings/thread_safe_interface_ptr.h" |
| 48 #include "net/base/network_change_notifier.h" | 52 #include "net/base/network_change_notifier.h" |
| 49 #include "third_party/WebKit/public/platform/WebConnectionType.h" | 53 #include "third_party/WebKit/public/platform/WebConnectionType.h" |
| 50 #include "third_party/WebKit/public/platform/scheduler/renderer/renderer_schedul
er.h" | 54 #include "third_party/WebKit/public/platform/scheduler/renderer/renderer_schedul
er.h" |
| 51 #include "third_party/WebKit/public/web/WebMemoryStatistics.h" | 55 #include "third_party/WebKit/public/web/WebMemoryStatistics.h" |
| 52 #include "ui/gfx/native_widget_types.h" | 56 #include "ui/gfx/native_widget_types.h" |
| (...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 307 } | 311 } |
| 308 | 312 |
| 309 DomStorageDispatcher* dom_storage_dispatcher() const { | 313 DomStorageDispatcher* dom_storage_dispatcher() const { |
| 310 return dom_storage_dispatcher_.get(); | 314 return dom_storage_dispatcher_.get(); |
| 311 } | 315 } |
| 312 | 316 |
| 313 AudioInputMessageFilter* audio_input_message_filter() { | 317 AudioInputMessageFilter* audio_input_message_filter() { |
| 314 return audio_input_message_filter_.get(); | 318 return audio_input_message_filter_.get(); |
| 315 } | 319 } |
| 316 | 320 |
| 317 AudioMessageFilter* audio_message_filter() { | |
| 318 return audio_message_filter_.get(); | |
| 319 } | |
| 320 | |
| 321 MidiMessageFilter* midi_message_filter() { | 321 MidiMessageFilter* midi_message_filter() { |
| 322 return midi_message_filter_.get(); | 322 return midi_message_filter_.get(); |
| 323 } | 323 } |
| 324 | 324 |
| 325 #if defined(OS_ANDROID) | 325 #if defined(OS_ANDROID) |
| 326 SynchronousCompositorFilter* sync_compositor_message_filter() { | 326 SynchronousCompositorFilter* sync_compositor_message_filter() { |
| 327 return sync_compositor_message_filter_.get(); | 327 return sync_compositor_message_filter_.get(); |
| 328 } | 328 } |
| 329 | 329 |
| 330 scoped_refptr<StreamTextureFactory> GetStreamTexureFactory(); | 330 scoped_refptr<StreamTextureFactory> GetStreamTexureFactory(); |
| (...skipping 277 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 608 std::unique_ptr<IndexedDBDispatcher> main_thread_indexed_db_dispatcher_; | 608 std::unique_ptr<IndexedDBDispatcher> main_thread_indexed_db_dispatcher_; |
| 609 std::unique_ptr<blink::scheduler::RendererScheduler> renderer_scheduler_; | 609 std::unique_ptr<blink::scheduler::RendererScheduler> renderer_scheduler_; |
| 610 std::unique_ptr<RendererBlinkPlatformImpl> blink_platform_impl_; | 610 std::unique_ptr<RendererBlinkPlatformImpl> blink_platform_impl_; |
| 611 std::unique_ptr<ResourceDispatchThrottler> resource_dispatch_throttler_; | 611 std::unique_ptr<ResourceDispatchThrottler> resource_dispatch_throttler_; |
| 612 std::unique_ptr<CacheStorageDispatcher> main_thread_cache_storage_dispatcher_; | 612 std::unique_ptr<CacheStorageDispatcher> main_thread_cache_storage_dispatcher_; |
| 613 | 613 |
| 614 // Used on the renderer and IPC threads. | 614 // Used on the renderer and IPC threads. |
| 615 scoped_refptr<BlobMessageFilter> blob_message_filter_; | 615 scoped_refptr<BlobMessageFilter> blob_message_filter_; |
| 616 scoped_refptr<DBMessageFilter> db_message_filter_; | 616 scoped_refptr<DBMessageFilter> db_message_filter_; |
| 617 scoped_refptr<AudioInputMessageFilter> audio_input_message_filter_; | 617 scoped_refptr<AudioInputMessageFilter> audio_input_message_filter_; |
| 618 scoped_refptr<AudioMessageFilter> audio_message_filter_; | |
| 619 scoped_refptr<MidiMessageFilter> midi_message_filter_; | 618 scoped_refptr<MidiMessageFilter> midi_message_filter_; |
| 620 scoped_refptr<DevToolsAgentFilter> devtools_agent_message_filter_; | 619 scoped_refptr<DevToolsAgentFilter> devtools_agent_message_filter_; |
| 621 | 620 |
| 622 std::unique_ptr<BrowserPluginManager> browser_plugin_manager_; | 621 std::unique_ptr<BrowserPluginManager> browser_plugin_manager_; |
| 623 | 622 |
| 624 #if BUILDFLAG(ENABLE_WEBRTC) | 623 #if BUILDFLAG(ENABLE_WEBRTC) |
| 625 std::unique_ptr<PeerConnectionDependencyFactory> peer_connection_factory_; | 624 std::unique_ptr<PeerConnectionDependencyFactory> peer_connection_factory_; |
| 626 | 625 |
| 627 // This is used to communicate to the browser process the status | 626 // This is used to communicate to the browser process the status |
| 628 // of all the peer connections created in the renderer. | 627 // of all the peer connections created in the renderer. |
| 629 std::unique_ptr<PeerConnectionTracker> peer_connection_tracker_; | 628 std::unique_ptr<PeerConnectionTracker> peer_connection_tracker_; |
| 630 | 629 |
| 631 // Dispatches all P2P sockets. | 630 // Dispatches all P2P sockets. |
| 632 scoped_refptr<P2PSocketDispatcher> p2p_socket_dispatcher_; | 631 scoped_refptr<P2PSocketDispatcher> p2p_socket_dispatcher_; |
| 633 | 632 |
| 634 // Used for communicating registering AEC dump consumers with the browser and | 633 // Used for communicating registering AEC dump consumers with the browser and |
| 635 // receving AEC dump file handles when AEC dump is enabled. An AEC dump is | 634 // receving AEC dump file handles when AEC dump is enabled. An AEC dump is |
| 636 // diagnostic audio data for WebRTC stored locally when enabled by the user in | 635 // diagnostic audio data for WebRTC stored locally when enabled by the user in |
| 637 // chrome://webrtc-internals. | 636 // chrome://webrtc-internals. |
| 638 scoped_refptr<AecDumpMessageFilter> aec_dump_message_filter_; | 637 scoped_refptr<AecDumpMessageFilter> aec_dump_message_filter_; |
| 639 #endif | 638 #endif |
| 640 | 639 |
| 640 // Provides AudioOutputIPC objects for audio output devices. It either uses |
| 641 // an AudioMessageFilter for this or provides MojoAudioOutputIPC objects. |
| 642 // Initialized in Init. |
| 643 base::Optional<AudioIPCFactory> audio_ipc_factory_; |
| 644 |
| 641 // Used on the render thread. | 645 // Used on the render thread. |
| 642 std::unique_ptr<VideoCaptureImplManager> vc_manager_; | 646 std::unique_ptr<VideoCaptureImplManager> vc_manager_; |
| 643 | 647 |
| 644 std::unique_ptr<ui::ChildSharedBitmapManager> shared_bitmap_manager_; | 648 std::unique_ptr<ui::ChildSharedBitmapManager> shared_bitmap_manager_; |
| 645 | 649 |
| 646 // The count of RenderWidgets running through this thread. | 650 // The count of RenderWidgets running through this thread. |
| 647 int widget_count_; | 651 int widget_count_; |
| 648 | 652 |
| 649 // The count of hidden RenderWidgets running through this thread. | 653 // The count of hidden RenderWidgets running through this thread. |
| 650 int hidden_widget_count_; | 654 int hidden_widget_count_; |
| (...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 798 DISALLOW_COPY_AND_ASSIGN(RenderThreadImpl); | 802 DISALLOW_COPY_AND_ASSIGN(RenderThreadImpl); |
| 799 }; | 803 }; |
| 800 | 804 |
| 801 #if defined(COMPILER_MSVC) | 805 #if defined(COMPILER_MSVC) |
| 802 #pragma warning(pop) | 806 #pragma warning(pop) |
| 803 #endif | 807 #endif |
| 804 | 808 |
| 805 } // namespace content | 809 } // namespace content |
| 806 | 810 |
| 807 #endif // CONTENT_RENDERER_RENDER_THREAD_IMPL_H_ | 811 #endif // CONTENT_RENDERER_RENDER_THREAD_IMPL_H_ |
| OLD | NEW |