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 #include "content/renderer/render_thread_impl.h" | 5 #include "content/renderer/render_thread_impl.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <limits> | 8 #include <limits> |
9 #include <map> | 9 #include <map> |
10 #include <vector> | 10 #include <vector> |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
68 #include "content/public/common/content_switches.h" | 68 #include "content/public/common/content_switches.h" |
69 #include "content/public/common/renderer_preferences.h" | 69 #include "content/public/common/renderer_preferences.h" |
70 #include "content/public/common/url_constants.h" | 70 #include "content/public/common/url_constants.h" |
71 #include "content/public/renderer/content_renderer_client.h" | 71 #include "content/public/renderer/content_renderer_client.h" |
72 #include "content/public/renderer/render_process_observer.h" | 72 #include "content/public/renderer/render_process_observer.h" |
73 #include "content/public/renderer/render_view_visitor.h" | 73 #include "content/public/renderer/render_view_visitor.h" |
74 #include "content/renderer/devtools/devtools_agent_filter.h" | 74 #include "content/renderer/devtools/devtools_agent_filter.h" |
75 #include "content/renderer/dom_storage/dom_storage_dispatcher.h" | 75 #include "content/renderer/dom_storage/dom_storage_dispatcher.h" |
76 #include "content/renderer/dom_storage/webstoragearea_impl.h" | 76 #include "content/renderer/dom_storage/webstoragearea_impl.h" |
77 #include "content/renderer/dom_storage/webstoragenamespace_impl.h" | 77 #include "content/renderer/dom_storage/webstoragenamespace_impl.h" |
| 78 #include "content/renderer/gpu/compositor_external_begin_frame_source.h" |
| 79 #include "content/renderer/gpu/compositor_forwarding_message_filter.h" |
78 #include "content/renderer/gpu/compositor_output_surface.h" | 80 #include "content/renderer/gpu/compositor_output_surface.h" |
79 #include "content/renderer/input/input_event_filter.h" | 81 #include "content/renderer/input/input_event_filter.h" |
80 #include "content/renderer/input/input_handler_manager.h" | 82 #include "content/renderer/input/input_handler_manager.h" |
81 #include "content/renderer/media/aec_dump_message_filter.h" | 83 #include "content/renderer/media/aec_dump_message_filter.h" |
82 #include "content/renderer/media/audio_input_message_filter.h" | 84 #include "content/renderer/media/audio_input_message_filter.h" |
83 #include "content/renderer/media/audio_message_filter.h" | 85 #include "content/renderer/media/audio_message_filter.h" |
84 #include "content/renderer/media/audio_renderer_mixer_manager.h" | 86 #include "content/renderer/media/audio_renderer_mixer_manager.h" |
85 #include "content/renderer/media/media_stream_center.h" | 87 #include "content/renderer/media/media_stream_center.h" |
86 #include "content/renderer/media/midi_message_filter.h" | 88 #include "content/renderer/media/midi_message_filter.h" |
87 #include "content/renderer/media/renderer_gpu_video_accelerator_factories.h" | 89 #include "content/renderer/media/renderer_gpu_video_accelerator_factories.h" |
88 #include "content/renderer/media/video_capture_impl_manager.h" | 90 #include "content/renderer/media/video_capture_impl_manager.h" |
89 #include "content/renderer/media/video_capture_message_filter.h" | 91 #include "content/renderer/media/video_capture_message_filter.h" |
90 #include "content/renderer/net_info_helper.h" | 92 #include "content/renderer/net_info_helper.h" |
91 #include "content/renderer/p2p/socket_dispatcher.h" | 93 #include "content/renderer/p2p/socket_dispatcher.h" |
92 #include "content/renderer/render_frame_proxy.h" | 94 #include "content/renderer/render_frame_proxy.h" |
93 #include "content/renderer/render_process_impl.h" | 95 #include "content/renderer/render_process_impl.h" |
94 #include "content/renderer/render_view_impl.h" | 96 #include "content/renderer/render_view_impl.h" |
95 #include "content/renderer/renderer_blink_platform_impl.h" | 97 #include "content/renderer/renderer_blink_platform_impl.h" |
96 #include "content/renderer/scheduler/renderer_scheduler.h" | 98 #include "content/renderer/scheduler/renderer_scheduler.h" |
97 #include "content/renderer/service_worker/embedded_worker_context_message_filter
.h" | 99 #include "content/renderer/service_worker/embedded_worker_context_message_filter
.h" |
98 #include "content/renderer/service_worker/embedded_worker_dispatcher.h" | 100 #include "content/renderer/service_worker/embedded_worker_dispatcher.h" |
99 #include "content/renderer/shared_worker/embedded_shared_worker_stub.h" | 101 #include "content/renderer/shared_worker/embedded_shared_worker_stub.h" |
100 #include "ipc/ipc_channel_handle.h" | 102 #include "ipc/ipc_channel_handle.h" |
101 #include "ipc/ipc_forwarding_message_filter.h" | |
102 #include "ipc/ipc_platform_file.h" | 103 #include "ipc/ipc_platform_file.h" |
103 #include "ipc/mojo/ipc_channel_mojo.h" | 104 #include "ipc/mojo/ipc_channel_mojo.h" |
104 #include "media/base/audio_hardware_config.h" | 105 #include "media/base/audio_hardware_config.h" |
105 #include "media/base/media.h" | 106 #include "media/base/media.h" |
106 #include "media/filters/gpu_video_accelerator_factories.h" | 107 #include "media/filters/gpu_video_accelerator_factories.h" |
107 #include "mojo/common/common_type_converters.h" | 108 #include "mojo/common/common_type_converters.h" |
108 #include "net/base/net_errors.h" | 109 #include "net/base/net_errors.h" |
109 #include "net/base/net_util.h" | 110 #include "net/base/net_util.h" |
110 #include "skia/ext/event_tracer_impl.h" | 111 #include "skia/ext/event_tracer_impl.h" |
111 #include "third_party/WebKit/public/platform/WebString.h" | 112 #include "third_party/WebKit/public/platform/WebString.h" |
(...skipping 517 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
629 RemoveFilter(vc_manager_->video_capture_message_filter()); | 630 RemoveFilter(vc_manager_->video_capture_message_filter()); |
630 vc_manager_.reset(); | 631 vc_manager_.reset(); |
631 | 632 |
632 RemoveFilter(db_message_filter_.get()); | 633 RemoveFilter(db_message_filter_.get()); |
633 db_message_filter_ = NULL; | 634 db_message_filter_ = NULL; |
634 | 635 |
635 // Shutdown the file thread if it's running. | 636 // Shutdown the file thread if it's running. |
636 if (file_thread_) | 637 if (file_thread_) |
637 file_thread_->Stop(); | 638 file_thread_->Stop(); |
638 | 639 |
639 if (compositor_output_surface_filter_.get()) { | 640 if (compositor_message_filter_.get()) { |
640 RemoveFilter(compositor_output_surface_filter_.get()); | 641 RemoveFilter(compositor_message_filter_.get()); |
641 compositor_output_surface_filter_ = NULL; | 642 compositor_message_filter_ = NULL; |
642 } | 643 } |
643 | 644 |
644 media_thread_.reset(); | 645 media_thread_.reset(); |
645 | 646 |
646 // AudioMessageFilter may be accessed on |media_thread_|, so shutdown after. | 647 // AudioMessageFilter may be accessed on |media_thread_|, so shutdown after. |
647 RemoveFilter(audio_message_filter_.get()); | 648 RemoveFilter(audio_message_filter_.get()); |
648 audio_message_filter_ = NULL; | 649 audio_message_filter_ = NULL; |
649 | 650 |
650 compositor_thread_.reset(); | 651 compositor_thread_.reset(); |
651 input_handler_manager_.reset(); | 652 input_handler_manager_.reset(); |
(...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
895 main_thread_compositor_task_runner_, | 896 main_thread_compositor_task_runner_, |
896 compositor_message_loop_proxy_); | 897 compositor_message_loop_proxy_); |
897 AddFilter(input_event_filter_.get()); | 898 AddFilter(input_event_filter_.get()); |
898 input_handler_manager_client = input_event_filter_.get(); | 899 input_handler_manager_client = input_event_filter_.get(); |
899 } | 900 } |
900 input_handler_manager_.reset( | 901 input_handler_manager_.reset( |
901 new InputHandlerManager(compositor_message_loop_proxy_, | 902 new InputHandlerManager(compositor_message_loop_proxy_, |
902 input_handler_manager_client)); | 903 input_handler_manager_client)); |
903 } | 904 } |
904 | 905 |
905 scoped_refptr<base::MessageLoopProxy> output_surface_loop; | 906 scoped_refptr<base::MessageLoopProxy> compositor_impl_side_loop; |
906 if (enable) | 907 if (enable) |
907 output_surface_loop = compositor_message_loop_proxy_; | 908 compositor_impl_side_loop = compositor_message_loop_proxy_; |
908 else | 909 else |
909 output_surface_loop = base::MessageLoopProxy::current(); | 910 compositor_impl_side_loop = base::MessageLoopProxy::current(); |
910 | 911 |
911 compositor_output_surface_filter_ = | 912 compositor_message_filter_ = new CompositorForwardingMessageFilter( |
912 CompositorOutputSurface::CreateFilter(output_surface_loop.get()); | 913 compositor_impl_side_loop.get()); |
913 AddFilter(compositor_output_surface_filter_.get()); | 914 AddFilter(compositor_message_filter_.get()); |
914 | 915 |
915 RenderThreadImpl::RegisterSchemes(); | 916 RenderThreadImpl::RegisterSchemes(); |
916 | 917 |
917 EnableBlinkPlatformLogChannels( | 918 EnableBlinkPlatformLogChannels( |
918 command_line.GetSwitchValueASCII(switches::kBlinkPlatformLogChannels)); | 919 command_line.GetSwitchValueASCII(switches::kBlinkPlatformLogChannels)); |
919 | 920 |
920 SetRuntimeFeaturesDefaultsAndUpdateFromArgs(command_line); | 921 SetRuntimeFeaturesDefaultsAndUpdateFromArgs(command_line); |
921 | 922 |
922 if (!media::IsMediaLibraryInitialized()) { | 923 if (!media::IsMediaLibraryInitialized()) { |
923 WebRuntimeFeatures::enableWebAudio(false); | 924 WebRuntimeFeatures::enableWebAudio(false); |
(...skipping 669 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1593 hidden_widget_count_--; | 1594 hidden_widget_count_--; |
1594 | 1595 |
1595 if (!GetContentClient()->renderer()->RunIdleHandlerWhenWidgetsHidden()) { | 1596 if (!GetContentClient()->renderer()->RunIdleHandlerWhenWidgetsHidden()) { |
1596 return; | 1597 return; |
1597 } | 1598 } |
1598 | 1599 |
1599 ScheduleIdleHandler(kLongIdleHandlerDelayMs); | 1600 ScheduleIdleHandler(kLongIdleHandlerDelayMs); |
1600 } | 1601 } |
1601 | 1602 |
1602 } // namespace content | 1603 } // namespace content |
OLD | NEW |