| Index: third_party/WebKit/Source/modules/gamepad/GamepadSharedMemoryReader.h
 | 
| diff --git a/third_party/WebKit/Source/modules/gamepad/GamepadSharedMemoryReader.h b/third_party/WebKit/Source/modules/gamepad/GamepadSharedMemoryReader.h
 | 
| new file mode 100644
 | 
| index 0000000000000000000000000000000000000000..7956a442d8d40a360e275604e668e0e23cd8c792
 | 
| --- /dev/null
 | 
| +++ b/third_party/WebKit/Source/modules/gamepad/GamepadSharedMemoryReader.h
 | 
| @@ -0,0 +1,58 @@
 | 
| +// 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 GamepadSharedMemoryReader_h
 | 
| +#define GamepadSharedMemoryReader_h
 | 
| +
 | 
| +#include "device/base/synchronization/shared_memory_seqlock_buffer.h"
 | 
| +#include "device/gamepad/public/interfaces/gamepad.mojom-blink.h"
 | 
| +#include "mojo/public/cpp/bindings/binding.h"
 | 
| +#include "mojo/public/cpp/system/buffer.h"
 | 
| +#include "public/platform/WebGamepadListener.h"
 | 
| +#include "public/platform/WebGamepads.h"
 | 
| +#include "wtf/Noncopyable.h"
 | 
| +
 | 
| +namespace blink {
 | 
| +
 | 
| +typedef device::SharedMemorySeqLockBuffer<WebGamepads> GamepadHardwareBuffer;
 | 
| +
 | 
| +class InterfaceProvider;
 | 
| +
 | 
| +class GamepadSharedMemoryReader final
 | 
| +    : public device::mojom::blink::
 | 
| +          GamepadObserver {  // heke:export?SampleGamepads..
 | 
| +  WTF_MAKE_NONCOPYABLE(GamepadSharedMemoryReader);
 | 
| +
 | 
| + public:
 | 
| +  explicit GamepadSharedMemoryReader(InterfaceProvider*);
 | 
| +  ~GamepadSharedMemoryReader() override;
 | 
| +
 | 
| +  void sampleGamepads(WebGamepads&);
 | 
| +  void start(WebGamepadListener*);
 | 
| +  void stop();
 | 
| +
 | 
| + protected:
 | 
| +  void sendStartMessage();
 | 
| +  void sendStopMessage();
 | 
| +
 | 
| + private:
 | 
| +  // device::mojom::blink::GamepadObserver methods.
 | 
| +  void GamepadConnected(int index, const ::blink::WebGamepad&) override;
 | 
| +  void GamepadDisconnected(int index, const ::blink::WebGamepad&) override;
 | 
| +
 | 
| +  mojo::ScopedSharedBufferHandle m_sharedBufferHandle;
 | 
| +  mojo::ScopedSharedBufferMapping m_sharedBufferMapping;
 | 
| +  GamepadHardwareBuffer* m_gamepadHardwareBuffer;
 | 
| +
 | 
| +  bool m_everInteracted;
 | 
| +  bool m_isObserving;
 | 
| +
 | 
| +  mojo::Binding<device::mojom::blink::GamepadObserver> m_binding;
 | 
| +  device::mojom::blink::GamepadMonitorPtr m_gamepadMonitor;
 | 
| +  WebGamepadListener* m_listener;
 | 
| +};
 | 
| +
 | 
| +}  // namespace blink
 | 
| +
 | 
| +#endif  // GamepadSharedMemoryReader_h
 | 
| 
 |