Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(142)

Side by Side Diff: content/renderer/render_thread_impl.cc

Issue 446603002: Refactor code listening to platform events in content/renderer/. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@webkitplatform_impl_start_stop
Patch Set: apply review comments Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
64 #include "content/public/common/url_constants.h" 64 #include "content/public/common/url_constants.h"
65 #include "content/public/renderer/content_renderer_client.h" 65 #include "content/public/renderer/content_renderer_client.h"
66 #include "content/public/renderer/render_process_observer.h" 66 #include "content/public/renderer/render_process_observer.h"
67 #include "content/public/renderer/render_view_visitor.h" 67 #include "content/public/renderer/render_view_visitor.h"
68 #include "content/renderer/compositor_bindings/web_external_bitmap_impl.h" 68 #include "content/renderer/compositor_bindings/web_external_bitmap_impl.h"
69 #include "content/renderer/compositor_bindings/web_layer_impl.h" 69 #include "content/renderer/compositor_bindings/web_layer_impl.h"
70 #include "content/renderer/devtools/devtools_agent_filter.h" 70 #include "content/renderer/devtools/devtools_agent_filter.h"
71 #include "content/renderer/dom_storage/dom_storage_dispatcher.h" 71 #include "content/renderer/dom_storage/dom_storage_dispatcher.h"
72 #include "content/renderer/dom_storage/webstoragearea_impl.h" 72 #include "content/renderer/dom_storage/webstoragearea_impl.h"
73 #include "content/renderer/dom_storage/webstoragenamespace_impl.h" 73 #include "content/renderer/dom_storage/webstoragenamespace_impl.h"
74 #include "content/renderer/gamepad_shared_memory_reader.h"
75 #include "content/renderer/gpu/compositor_output_surface.h" 74 #include "content/renderer/gpu/compositor_output_surface.h"
76 #include "content/renderer/gpu/gpu_benchmarking_extension.h" 75 #include "content/renderer/gpu/gpu_benchmarking_extension.h"
77 #include "content/renderer/input/input_event_filter.h" 76 #include "content/renderer/input/input_event_filter.h"
78 #include "content/renderer/input/input_handler_manager.h" 77 #include "content/renderer/input/input_handler_manager.h"
79 #include "content/renderer/media/aec_dump_message_filter.h" 78 #include "content/renderer/media/aec_dump_message_filter.h"
80 #include "content/renderer/media/audio_input_message_filter.h" 79 #include "content/renderer/media/audio_input_message_filter.h"
81 #include "content/renderer/media/audio_message_filter.h" 80 #include "content/renderer/media/audio_message_filter.h"
82 #include "content/renderer/media/audio_renderer_mixer_manager.h" 81 #include "content/renderer/media/audio_renderer_mixer_manager.h"
83 #include "content/renderer/media/media_stream_center.h" 82 #include "content/renderer/media/media_stream_center.h"
84 #include "content/renderer/media/midi_message_filter.h" 83 #include "content/renderer/media/midi_message_filter.h"
(...skipping 793 matching lines...) Expand 10 before | Expand all | Expand 10 after
878 scoped_refptr<base::MessageLoopProxy> output_surface_loop; 877 scoped_refptr<base::MessageLoopProxy> output_surface_loop;
879 if (enable) 878 if (enable)
880 output_surface_loop = compositor_message_loop_proxy_; 879 output_surface_loop = compositor_message_loop_proxy_;
881 else 880 else
882 output_surface_loop = base::MessageLoopProxy::current(); 881 output_surface_loop = base::MessageLoopProxy::current();
883 882
884 compositor_output_surface_filter_ = 883 compositor_output_surface_filter_ =
885 CompositorOutputSurface::CreateFilter(output_surface_loop.get()); 884 CompositorOutputSurface::CreateFilter(output_surface_loop.get());
886 AddFilter(compositor_output_surface_filter_.get()); 885 AddFilter(compositor_output_surface_filter_.get());
887 886
888 gamepad_shared_memory_reader_.reset(
889 new GamepadSharedMemoryReader(webkit_platform_support_.get()));
890 AddObserver(gamepad_shared_memory_reader_.get());
891
892 RenderThreadImpl::RegisterSchemes(); 887 RenderThreadImpl::RegisterSchemes();
893 888
894 EnableBlinkPlatformLogChannels( 889 EnableBlinkPlatformLogChannels(
895 command_line.GetSwitchValueASCII(switches::kBlinkPlatformLogChannels)); 890 command_line.GetSwitchValueASCII(switches::kBlinkPlatformLogChannels));
896 891
897 SetRuntimeFeaturesDefaultsAndUpdateFromArgs(command_line); 892 SetRuntimeFeaturesDefaultsAndUpdateFromArgs(command_line);
898 893
899 if (!media::IsMediaLibraryInitialized()) { 894 if (!media::IsMediaLibraryInitialized()) {
900 WebRuntimeFeatures::enableMediaPlayer(false); 895 WebRuntimeFeatures::enableMediaPlayer(false);
901 WebRuntimeFeatures::enableWebAudio(false); 896 WebRuntimeFeatures::enableWebAudio(false);
(...skipping 694 matching lines...) Expand 10 before | Expand all | Expand 10 after
1596 1591
1597 void RenderThreadImpl::SetFlingCurveParameters( 1592 void RenderThreadImpl::SetFlingCurveParameters(
1598 const std::vector<float>& new_touchpad, 1593 const std::vector<float>& new_touchpad,
1599 const std::vector<float>& new_touchscreen) { 1594 const std::vector<float>& new_touchscreen) {
1600 webkit_platform_support_->SetFlingCurveParameters(new_touchpad, 1595 webkit_platform_support_->SetFlingCurveParameters(new_touchpad,
1601 new_touchscreen); 1596 new_touchscreen);
1602 1597
1603 } 1598 }
1604 1599
1605 void RenderThreadImpl::SampleGamepads(blink::WebGamepads* data) { 1600 void RenderThreadImpl::SampleGamepads(blink::WebGamepads* data) {
1606 gamepad_shared_memory_reader_->SampleGamepads(*data); 1601 webkit_platform_support_->sampleGamepads(*data);
1607 }
1608
1609 void RenderThreadImpl::SetGamepadListener(blink::WebGamepadListener* listener) {
1610 gamepad_shared_memory_reader_->SetGamepadListener(listener);
1611 } 1602 }
1612 1603
1613 void RenderThreadImpl::WidgetCreated() { 1604 void RenderThreadImpl::WidgetCreated() {
1614 widget_count_++; 1605 widget_count_++;
1615 } 1606 }
1616 1607
1617 void RenderThreadImpl::WidgetDestroyed() { 1608 void RenderThreadImpl::WidgetDestroyed() {
1618 widget_count_--; 1609 widget_count_--;
1619 } 1610 }
1620 1611
(...skipping 12 matching lines...) Expand all
1633 hidden_widget_count_--; 1624 hidden_widget_count_--;
1634 1625
1635 if (!GetContentClient()->renderer()->RunIdleHandlerWhenWidgetsHidden()) { 1626 if (!GetContentClient()->renderer()->RunIdleHandlerWhenWidgetsHidden()) {
1636 return; 1627 return;
1637 } 1628 }
1638 1629
1639 ScheduleIdleHandler(kLongIdleHandlerDelayMs); 1630 ScheduleIdleHandler(kLongIdleHandlerDelayMs);
1640 } 1631 }
1641 1632
1642 } // namespace content 1633 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698