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

Unified Diff: content/browser/gamepad/gamepad_service.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_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_;

Powered by Google App Engine
This is Rietveld 408576698