Index: content/browser/gamepad/gamepad_service.h |
diff --git a/content/browser/gamepad/gamepad_service.h b/content/browser/gamepad/gamepad_service.h |
index 94620b34b60f901c8b1bfb4865d3092eeb313ee8..1343c9d32e079eaa4fdabc5a02114149345cf83e 100644 |
--- a/content/browser/gamepad/gamepad_service.h |
+++ b/content/browser/gamepad/gamepad_service.h |
@@ -1,4 +1,5 @@ |
// Copyright (c) 2012 The Chromium Authors. All rights reserved. |
+// Copyright (c) 2014, NVIDIA CORPORATION. All rights reserved. |
// Use of this source code is governed by a BSD-style license that can be |
// found in the LICENSE file. |
@@ -11,6 +12,7 @@ |
#include "base/memory/shared_memory.h" |
#include "base/memory/singleton.h" |
#include "base/threading/thread_checker.h" |
+#include "base/time/time.h" |
#include "content/common/content_export.h" |
namespace content { |
@@ -44,6 +46,22 @@ class CONTENT_EXPORT GamepadService { |
// while a consumer is active. |
void RegisterForUserGesture(const base::Closure& closure); |
+#if defined(OS_ANDROID) |
+ // Setter amd getter for the last Gamepad Data access timestamp accessed by |
+ // the consumer |
+ void SetGamepadAccessTimestamp(base::Time); |
+ base::Time GetGamepadAccessTimestamp(); |
+ |
+ // Returns the state of polling thread regarding Gamepad Data reads via |
+ // low-level data fetcher i.e. Paused or Resuming |
+ bool GetPollState(); |
+ |
+ // Manages pause and resume state of polling thread in GamepadProvider |
+ // |provider_|. |
+ void Pause(); |
+ void Resume(); |
+#endif |
+ |
// Returns the shared memory handle of the gamepad data duplicated into the |
// given process. |
base::SharedMemoryHandle GetSharedMemoryHandleForProcess( |
@@ -65,6 +83,11 @@ class CONTENT_EXPORT GamepadService { |
virtual ~GamepadService(); |
int num_readers_; |
+ |
+#if defined(OS_ANDROID) |
+ // Maintans the timestamp for last Gamepad Data access |
+ base::Time gamepad_access_timestamp_; |
+#endif |
scoped_ptr<GamepadProvider> provider_; |
base::ThreadChecker thread_checker_; |