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

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

Issue 133943002: Gamepad API support for chrome on android (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 6 years, 11 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.h
diff --git a/content/browser/gamepad/gamepad_provider.h b/content/browser/gamepad/gamepad_provider.h
index 5f10f137a14ed8311b94a25d7242fa9596ef227f..488aff6934a5e6f722f9e15b6909a7c4405f7d20 100644
--- a/content/browser/gamepad/gamepad_provider.h
+++ b/content/browser/gamepad/gamepad_provider.h
@@ -43,6 +43,10 @@ class CONTENT_EXPORT GamepadProvider :
base::SharedMemoryHandle GetSharedMemoryHandleForProcess(
base::ProcessHandle renderer_process);
+ // Returns the state of polling thread regarding Gamepad Data reads via
+ // low-level data fetcher i.e. Paused or Resuming
+ bool GetPollState();
+
// Pause and resume the background polling thread. Can be called from any
// thread.
void Pause();
@@ -93,6 +97,11 @@ class CONTENT_EXPORT GamepadProvider :
// thread, the message loop proxies will normally just be the I/O thread.
// However, this will be the main thread for unit testing.
base::Lock user_gesture_lock_;
+
+ // Maximum time allowed for the thread before polling gets paused in
+ // milliseconds after last gamepad data access from consumer
+ static const int64 max_timestamp_before_pause_;
+
struct ClosureAndThread {
ClosureAndThread(const base::Closure& c,
const scoped_refptr<base::MessageLoopProxy>& m);

Powered by Google App Engine
This is Rietveld 408576698