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

Unified Diff: Source/modules/gamepad/NavigatorGamepad.h

Issue 346273008: Gamepad: make gamepad events play well with page visibility (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@gamepad-vis
Patch Set: PersistentHeapDequeWillBeHeapDeque Created 6 years, 5 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
« no previous file with comments | « LayoutTests/gamepad/page-visibility-expected.txt ('k') | Source/modules/gamepad/NavigatorGamepad.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/modules/gamepad/NavigatorGamepad.h
diff --git a/Source/modules/gamepad/NavigatorGamepad.h b/Source/modules/gamepad/NavigatorGamepad.h
index 78cfc18f29e998d4305582e674ac0b950cec6007..d4705b9faf774af71278c76f863df7ccc4bbfea2 100644
--- a/Source/modules/gamepad/NavigatorGamepad.h
+++ b/Source/modules/gamepad/NavigatorGamepad.h
@@ -29,6 +29,7 @@
#include "core/frame/DOMWindowLifecycleObserver.h"
#include "core/frame/DOMWindowProperty.h"
#include "core/frame/DeviceEventControllerBase.h"
+#include "platform/AsyncMethodRunner.h"
#include "platform/Supplementable.h"
#include "platform/heap/Handle.h"
#include "public/platform/WebGamepads.h"
@@ -41,6 +42,7 @@ class WebGamepads;
namespace WebCore {
class Document;
+class Gamepad;
class GamepadList;
class Navigator;
class WebKitGamepadList;
@@ -67,6 +69,9 @@ private:
static const char* supplementName();
+ void dispatchOneEvent();
+ void didRemoveGamepadEventListeners();
+
// DOMWindowProperty
virtual void willDestroyGlobalObjectInFrame() OVERRIDE;
virtual void willDetachGlobalObjectFromFrame() OVERRIDE;
@@ -85,6 +90,8 @@ private:
PersistentWillBeMember<GamepadList> m_gamepads;
PersistentWillBeMember<WebKitGamepadList> m_webkitGamepads;
+ PersistentHeapDequeWillBeHeapDeque<Member<Gamepad> > m_pendingEvents;
+ AsyncMethodRunner<NavigatorGamepad> m_dispatchOneEventRunner;
};
} // namespace WebCore
« no previous file with comments | « LayoutTests/gamepad/page-visibility-expected.txt ('k') | Source/modules/gamepad/NavigatorGamepad.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698