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_; |