| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef DEVICE_GAMEPAD_GAMEPAD_PROVIDER_H_ | 5 #ifndef DEVICE_GAMEPAD_GAMEPAD_PROVIDER_H_ |
| 6 #define DEVICE_GAMEPAD_GAMEPAD_PROVIDER_H_ | 6 #define DEVICE_GAMEPAD_GAMEPAD_PROVIDER_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 #include <utility> | 9 #include <utility> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 51 GamepadConnectionChangeClient* connection_change_client, | 51 GamepadConnectionChangeClient* connection_change_client, |
| 52 std::unique_ptr<GamepadDataFetcher> fetcher); | 52 std::unique_ptr<GamepadDataFetcher> fetcher); |
| 53 | 53 |
| 54 ~GamepadProvider() override; | 54 ~GamepadProvider() override; |
| 55 | 55 |
| 56 // Returns the shared memory handle of the gamepad data duplicated into the | 56 // Returns the shared memory handle of the gamepad data duplicated into the |
| 57 // given process. | 57 // given process. |
| 58 base::SharedMemoryHandle GetSharedMemoryHandleForProcess( | 58 base::SharedMemoryHandle GetSharedMemoryHandleForProcess( |
| 59 base::ProcessHandle renderer_process); | 59 base::ProcessHandle renderer_process); |
| 60 | 60 |
| 61 // Returns the shared memory handle of the gamepad data. |
| 62 base::SharedMemoryHandle GetSharedMemoryHandle(); |
| 63 |
| 61 void AddGamepadDataFetcher(GamepadDataFetcher* fetcher); | 64 void AddGamepadDataFetcher(GamepadDataFetcher* fetcher); |
| 62 void RemoveGamepadDataFetcher(GamepadDataFetcher* fetcher); | 65 void RemoveGamepadDataFetcher(GamepadDataFetcher* fetcher); |
| 63 | 66 |
| 64 void GetCurrentGamepadData(blink::WebGamepads* data); | 67 void GetCurrentGamepadData(blink::WebGamepads* data); |
| 65 | 68 |
| 66 // Pause and resume the background polling thread. Can be called from any | 69 // Pause and resume the background polling thread. Can be called from any |
| 67 // thread. | 70 // thread. |
| 68 void Pause(); | 71 void Pause(); |
| 69 void Resume(); | 72 void Resume(); |
| 70 | 73 |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 158 std::unique_ptr<base::Thread> polling_thread_; | 161 std::unique_ptr<base::Thread> polling_thread_; |
| 159 | 162 |
| 160 GamepadConnectionChangeClient* connection_change_client_; | 163 GamepadConnectionChangeClient* connection_change_client_; |
| 161 | 164 |
| 162 DISALLOW_COPY_AND_ASSIGN(GamepadProvider); | 165 DISALLOW_COPY_AND_ASSIGN(GamepadProvider); |
| 163 }; | 166 }; |
| 164 | 167 |
| 165 } // namespace device | 168 } // namespace device |
| 166 | 169 |
| 167 #endif // DEVICE_GAMEPAD_GAMEPAD_PROVIDER_H_ | 170 #endif // DEVICE_GAMEPAD_GAMEPAD_PROVIDER_H_ |
| OLD | NEW |