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

Unified Diff: content/renderer/render_thread_impl.cc

Issue 195873019: Gamepad API: add support for connection events (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: add some more comments Created 6 years, 9 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 side-by-side diff with in-line comments
Download patch
Index: content/renderer/render_thread_impl.cc
diff --git a/content/renderer/render_thread_impl.cc b/content/renderer/render_thread_impl.cc
index 140fa7990e5c31784072bdd312920ac316cf63df..357d24cf89560b251e5d7ed7e9d5c6236f2112ea 100644
--- a/content/renderer/render_thread_impl.cc
+++ b/content/renderer/render_thread_impl.cc
@@ -402,6 +402,10 @@ void RenderThreadImpl::Init() {
new MojoRenderProcessObserver(this);
#endif
+ gamepad_shared_memory_reader_ =
+ new GamepadSharedMemoryReader(GetIOMessageLoopProxy());
+ AddFilter(gamepad_shared_memory_reader_.get());
+
GetContentClient()->renderer()->RenderThreadStarted();
InitSkiaEventTracer();
@@ -1488,11 +1492,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_++;
}

Powered by Google App Engine
This is Rietveld 408576698