bug 936104 - pages using only navigator.getGamepads should trigger gamepad backend startup. r=smaug
authorTed Mielczarek <ted@mielczarek.org>
Fri, 06 Dec 2013 06:52:06 -0500
changeset 174834 20a6f6176960b5cdf2f346f6dba9100fc7a94ccb
parent 174833 d4ca041c97b45fbe983d70b9e3eea10a51638ad8
child 174835 759dfb425bbb6ba3a6b9dd9ec558e9a0911ae86f
push id445
push userffxbld
push dateMon, 10 Mar 2014 22:05:19 +0000
treeherdermozilla-release@dc38b741b04e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssmaug
bugs936104
milestone28.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
bug 936104 - pages using only navigator.getGamepads should trigger gamepad backend startup. r=smaug
dom/base/Navigator.cpp
--- a/dom/base/Navigator.cpp
+++ b/dom/base/Navigator.cpp
@@ -1251,16 +1251,17 @@ Navigator::GetGamepads(nsTArray<nsRefPtr
                        ErrorResult& aRv)
 {
   if (!mWindow) {
     aRv.Throw(NS_ERROR_UNEXPECTED);
     return;
   }
   NS_ENSURE_TRUE_VOID(mWindow->GetDocShell());
   nsGlobalWindow* win = static_cast<nsGlobalWindow*>(mWindow.get());
+  win->SetHasGamepadEventListener(true);
   win->GetGamepads(aGamepads);
 }
 #endif
 
 //*****************************************************************************
 //    Navigator::nsIMozNavigatorNetwork
 //*****************************************************************************