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

Unified Diff: content/renderer/gamepad_shared_memory_reader.h

Issue 8689011: Renderer reading side of gamepad (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: move seqlock to gamepad-specific, improve description 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
Index: content/renderer/gamepad_shared_memory_reader.h
diff --git a/content/renderer/gamepad_shared_memory_reader.h b/content/renderer/gamepad_shared_memory_reader.h
new file mode 100644
index 0000000000000000000000000000000000000000..008e8ba69d9a09a4c86c486696d324f043aabc1f
--- /dev/null
+++ b/content/renderer/gamepad_shared_memory_reader.h
@@ -0,0 +1,34 @@
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef GAMEPAD_UTIL_H_
+#define GAMEPAD_UTIL_H_
+
+#include "base/shared_memory.h"
+#include "base/memory/scoped_ptr.h"
+#include "third_party/WebKit/Source/WebKit/chromium/public/WebGamepads.h"
+
+namespace gamepad {
+struct GamepadHardwareBuffer;
+}
+
+namespace content {
+
+class GamepadSharedMemoryReader {
+ public:
+ GamepadSharedMemoryReader();
+ virtual ~GamepadSharedMemoryReader();
+ void SampleGamepads(WebKit::WebGamepads&);
+
+ private:
+ base::SharedMemoryHandle renderer_shared_memory_handle_;
+ scoped_ptr<base::SharedMemory> renderer_shared_memory_;
+ gamepad::GamepadHardwareBuffer* gamepad_hardware_buffer_;
+
+ bool ever_interacted_with_[WebKit::WebGamepads::itemsLengthCap];
+};
+
+} // namespace content
+
+#endif // GAMEPAD_UTIL_H_

Powered by Google App Engine
This is Rietveld 408576698