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

Unified Diff: content/browser/gamepad/gamepad_provider.cc

Issue 135523006: Implemented Gamepad support via Raw Input on Windows (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 6 years, 10 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/browser/gamepad/gamepad_provider.cc
diff --git a/content/browser/gamepad/gamepad_provider.cc b/content/browser/gamepad/gamepad_provider.cc
index 55a5f30ed78b6802c7fd6231a13bd0d596c958c8..1cc7aab73f5daba2e6984c3e626275c27fbf06b8 100644
--- a/content/browser/gamepad/gamepad_provider.cc
+++ b/content/browser/gamepad/gamepad_provider.cc
@@ -113,15 +113,15 @@ void GamepadProvider::Initialize(scoped_ptr<GamepadDataFetcher> fetcher) {
memset(hwbuf, 0, sizeof(GamepadHardwareBuffer));
polling_thread_.reset(new base::Thread("Gamepad polling thread"));
-#if defined(OS_MACOSX)
- // On Mac, the data fetcher uses IOKit which depends on CFRunLoop, so the
- // message loop needs to be a UI-type loop.
- const base::MessageLoop::Type kMessageLoopType = base::MessageLoop::TYPE_UI;
-#else
+#if defined(OS_LINUX)
// On Linux, the data fetcher needs to watch file descriptors, so the message
- // loop needs to be a libevent loop. On Windows it doesn't matter what the
- // loop is.
+ // loop needs to be a libevent loop.
const base::MessageLoop::Type kMessageLoopType = base::MessageLoop::TYPE_IO;
+#else
+ // On Mac, the data fetcher uses IOKit which depends on CFRunLoop, so the
+ // message loop needs to be a UI-type loop. On Windows it must be a UI loop
+ // to properly pump the MessageWindow that captures device state.
+ const base::MessageLoop::Type kMessageLoopType = base::MessageLoop::TYPE_UI;
#endif
polling_thread_->StartWithOptions(base::Thread::Options(kMessageLoopType, 0));
« no previous file with comments | « content/browser/gamepad/gamepad_platform_data_fetcher_win.cc ('k') | content/browser/gamepad/gamepad_standard_mappings_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698