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 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
65 #include "content/public/common/content_switches.h" | 65 #include "content/public/common/content_switches.h" |
66 #include "content/public/common/renderer_preferences.h" | 66 #include "content/public/common/renderer_preferences.h" |
67 #include "content/public/common/url_constants.h" | 67 #include "content/public/common/url_constants.h" |
68 #include "content/public/renderer/content_renderer_client.h" | 68 #include "content/public/renderer/content_renderer_client.h" |
69 #include "content/public/renderer/render_process_observer.h" | 69 #include "content/public/renderer/render_process_observer.h" |
70 #include "content/public/renderer/render_view_visitor.h" | 70 #include "content/public/renderer/render_view_visitor.h" |
71 #include "content/renderer/devtools/devtools_agent_filter.h" | 71 #include "content/renderer/devtools/devtools_agent_filter.h" |
72 #include "content/renderer/dom_storage/dom_storage_dispatcher.h" | 72 #include "content/renderer/dom_storage/dom_storage_dispatcher.h" |
73 #include "content/renderer/dom_storage/webstoragearea_impl.h" | 73 #include "content/renderer/dom_storage/webstoragearea_impl.h" |
74 #include "content/renderer/dom_storage/webstoragenamespace_impl.h" | 74 #include "content/renderer/dom_storage/webstoragenamespace_impl.h" |
75 #include "content/renderer/gamepad_shared_memory_reader.h" | |
76 #include "content/renderer/gpu/compositor_output_surface.h" | 75 #include "content/renderer/gpu/compositor_output_surface.h" |
77 #include "content/renderer/gpu/gpu_benchmarking_extension.h" | 76 #include "content/renderer/gpu/gpu_benchmarking_extension.h" |
78 #include "content/renderer/input/input_event_filter.h" | 77 #include "content/renderer/input/input_event_filter.h" |
79 #include "content/renderer/input/input_handler_manager.h" | 78 #include "content/renderer/input/input_handler_manager.h" |
80 #include "content/renderer/media/aec_dump_message_filter.h" | 79 #include "content/renderer/media/aec_dump_message_filter.h" |
81 #include "content/renderer/media/audio_input_message_filter.h" | 80 #include "content/renderer/media/audio_input_message_filter.h" |
82 #include "content/renderer/media/audio_message_filter.h" | 81 #include "content/renderer/media/audio_message_filter.h" |
83 #include "content/renderer/media/audio_renderer_mixer_manager.h" | 82 #include "content/renderer/media/audio_renderer_mixer_manager.h" |
84 #include "content/renderer/media/media_stream_center.h" | 83 #include "content/renderer/media/media_stream_center.h" |
85 #include "content/renderer/media/midi_message_filter.h" | 84 #include "content/renderer/media/midi_message_filter.h" |
(...skipping 806 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
892 scoped_refptr<base::MessageLoopProxy> output_surface_loop; | 891 scoped_refptr<base::MessageLoopProxy> output_surface_loop; |
893 if (enable) | 892 if (enable) |
894 output_surface_loop = compositor_message_loop_proxy_; | 893 output_surface_loop = compositor_message_loop_proxy_; |
895 else | 894 else |
896 output_surface_loop = base::MessageLoopProxy::current(); | 895 output_surface_loop = base::MessageLoopProxy::current(); |
897 | 896 |
898 compositor_output_surface_filter_ = | 897 compositor_output_surface_filter_ = |
899 CompositorOutputSurface::CreateFilter(output_surface_loop.get()); | 898 CompositorOutputSurface::CreateFilter(output_surface_loop.get()); |
900 AddFilter(compositor_output_surface_filter_.get()); | 899 AddFilter(compositor_output_surface_filter_.get()); |
901 | 900 |
902 gamepad_shared_memory_reader_.reset( | |
903 new GamepadSharedMemoryReader(webkit_platform_support_.get())); | |
904 AddObserver(gamepad_shared_memory_reader_.get()); | |
905 | |
906 RenderThreadImpl::RegisterSchemes(); | 901 RenderThreadImpl::RegisterSchemes(); |
907 | 902 |
908 EnableBlinkPlatformLogChannels( | 903 EnableBlinkPlatformLogChannels( |
909 command_line.GetSwitchValueASCII(switches::kBlinkPlatformLogChannels)); | 904 command_line.GetSwitchValueASCII(switches::kBlinkPlatformLogChannels)); |
910 | 905 |
911 SetRuntimeFeaturesDefaultsAndUpdateFromArgs(command_line); | 906 SetRuntimeFeaturesDefaultsAndUpdateFromArgs(command_line); |
912 | 907 |
913 if (!media::IsMediaLibraryInitialized()) { | 908 if (!media::IsMediaLibraryInitialized()) { |
914 WebRuntimeFeatures::enableMediaPlayer(false); | 909 WebRuntimeFeatures::enableMediaPlayer(false); |
915 WebRuntimeFeatures::enableWebAudio(false); | 910 WebRuntimeFeatures::enableWebAudio(false); |
(...skipping 695 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1611 | 1606 |
1612 void RenderThreadImpl::SetFlingCurveParameters( | 1607 void RenderThreadImpl::SetFlingCurveParameters( |
1613 const std::vector<float>& new_touchpad, | 1608 const std::vector<float>& new_touchpad, |
1614 const std::vector<float>& new_touchscreen) { | 1609 const std::vector<float>& new_touchscreen) { |
1615 webkit_platform_support_->SetFlingCurveParameters(new_touchpad, | 1610 webkit_platform_support_->SetFlingCurveParameters(new_touchpad, |
1616 new_touchscreen); | 1611 new_touchscreen); |
1617 | 1612 |
1618 } | 1613 } |
1619 | 1614 |
1620 void RenderThreadImpl::SampleGamepads(blink::WebGamepads* data) { | 1615 void RenderThreadImpl::SampleGamepads(blink::WebGamepads* data) { |
1621 gamepad_shared_memory_reader_->SampleGamepads(*data); | 1616 webkit_platform_support_->sampleGamepads(*data); |
1622 } | |
1623 | |
1624 void RenderThreadImpl::SetGamepadListener(blink::WebGamepadListener* listener) { | |
1625 gamepad_shared_memory_reader_->SetGamepadListener(listener); | |
1626 } | 1617 } |
1627 | 1618 |
1628 void RenderThreadImpl::WidgetCreated() { | 1619 void RenderThreadImpl::WidgetCreated() { |
1629 widget_count_++; | 1620 widget_count_++; |
1630 } | 1621 } |
1631 | 1622 |
1632 void RenderThreadImpl::WidgetDestroyed() { | 1623 void RenderThreadImpl::WidgetDestroyed() { |
1633 widget_count_--; | 1624 widget_count_--; |
1634 } | 1625 } |
1635 | 1626 |
(...skipping 18 matching lines...) Expand all Loading... |
1654 hidden_widget_count_--; | 1645 hidden_widget_count_--; |
1655 | 1646 |
1656 if (!GetContentClient()->renderer()->RunIdleHandlerWhenWidgetsHidden()) { | 1647 if (!GetContentClient()->renderer()->RunIdleHandlerWhenWidgetsHidden()) { |
1657 return; | 1648 return; |
1658 } | 1649 } |
1659 | 1650 |
1660 ScheduleIdleHandler(kLongIdleHandlerDelayMs); | 1651 ScheduleIdleHandler(kLongIdleHandlerDelayMs); |
1661 } | 1652 } |
1662 | 1653 |
1663 } // namespace content | 1654 } // namespace content |
OLD | NEW |