Index: content/renderer/render_thread_impl.cc |
diff --git a/content/renderer/render_thread_impl.cc b/content/renderer/render_thread_impl.cc |
index 08016d760e1858be4431575e2cf3e711ccbc583c..5e24d9bd0cfa520dde3876fa09ea5b2df98657ad 100644 |
--- a/content/renderer/render_thread_impl.cc |
+++ b/content/renderer/render_thread_impl.cc |
@@ -396,6 +396,9 @@ void RenderThreadImpl::Init() { |
AddFilter((new EmbeddedWorkerContextMessageFilter())->GetFilter()); |
+ gamepad_shared_memory_reader_.reset(new GamepadSharedMemoryReader()); |
+ AddObserver(gamepad_shared_memory_reader_.get()); |
+ |
GetContentClient()->renderer()->RenderThreadStarted(); |
InitSkiaEventTracer(); |
@@ -1458,11 +1461,13 @@ void RenderThreadImpl::SetFlingCurveParameters( |
} |
void RenderThreadImpl::SampleGamepads(blink::WebGamepads* data) { |
- if (!gamepad_shared_memory_reader_) |
- gamepad_shared_memory_reader_.reset(new GamepadSharedMemoryReader); |
gamepad_shared_memory_reader_->SampleGamepads(*data); |
} |
+void RenderThreadImpl::SetGamepadListener(blink::WebGamepadListener* listener) { |
+ gamepad_shared_memory_reader_->SetGamepadListener(listener); |
+} |
+ |
void RenderThreadImpl::WidgetCreated() { |
widget_count_++; |
} |