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

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

Issue 8345027: Big patch to implement Chromium-side of Gamepad support (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: minor tidying Created 9 years, 1 month 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 | « no previous file | content/browser/gamepad/gamepad_provider.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/gamepad/gamepad_provider.h
diff --git a/content/browser/gamepad/gamepad_provider.h b/content/browser/gamepad/gamepad_provider.h
index a40047d6b680661e13631ce19ca23af04d5b74b5..f569b829de6d9c84942a19937e556b0dd3bcfc76 100644
--- a/content/browser/gamepad/gamepad_provider.h
+++ b/content/browser/gamepad/gamepad_provider.h
@@ -9,6 +9,7 @@
#include "base/memory/weak_ptr.h"
#include "base/message_loop_proxy.h"
#include "base/shared_memory.h"
+#include "base/synchronization/lock.h"
#include "base/system_monitor/system_monitor.h"
#include "base/task.h"
#include "content/browser/gamepad/data_fetcher.h"
@@ -29,12 +30,12 @@ class CONTENT_EXPORT GamepadProvider :
public:
explicit GamepadProvider(GamepadDataFetcher* fetcher);
- // Starts or Stops the provider. Called from creator_loop_.
- void Start();
- void Stop();
base::SharedMemoryHandle GetRendererSharedMemoryHandle(
base::ProcessHandle renderer_process);
+ void Pause();
+ void Resume();
+
private:
friend class base::RefCountedThreadSafe<GamepadProvider>;
@@ -53,6 +54,12 @@ class CONTENT_EXPORT GamepadProvider :
enum { kDesiredSamplingIntervalMs = 16 };
+ base::Lock is_paused_lock_;
+ bool is_paused_;
+
+ base::Lock devices_changed_lock_;
+ bool devices_changed_;
+
// The Message Loop on which this object was created.
// Typically the I/O loop, but may be something else during testing.
scoped_refptr<base::MessageLoopProxy> creator_loop_;
@@ -62,7 +69,6 @@ class CONTENT_EXPORT GamepadProvider :
// from that thread.
scoped_ptr<GamepadDataFetcher> data_fetcher_;
base::SharedMemory gamepad_shared_memory_;
- bool devices_changed_;
// Polling is done on this background thread.
scoped_ptr<base::Thread> polling_thread_;
« no previous file with comments | « no previous file | content/browser/gamepad/gamepad_provider.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698