| 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 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 44 explicit GamepadProvider( | 44 explicit GamepadProvider( |
| 45 GamepadConnectionChangeClient* connection_change_client); | 45 GamepadConnectionChangeClient* connection_change_client); |
| 46 | 46 |
| 47 // Manually specifies the data fetcher. Used for testing. | 47 // Manually specifies the data fetcher. Used for testing. |
| 48 explicit GamepadProvider( | 48 explicit GamepadProvider( |
| 49 GamepadConnectionChangeClient* connection_change_client, | 49 GamepadConnectionChangeClient* connection_change_client, |
| 50 std::unique_ptr<GamepadDataFetcher> fetcher); | 50 std::unique_ptr<GamepadDataFetcher> fetcher); |
| 51 | 51 |
| 52 ~GamepadProvider() override; | 52 ~GamepadProvider() override; |
| 53 | 53 |
| 54 // Returns the shared memory handle of the gamepad data duplicated into the | 54 // Returns a duplicate of the shared memory handle of the gamepad data. |
| 55 // given process. | 55 base::SharedMemoryHandle DuplicateSharedMemoryHandle(); |
| 56 base::SharedMemoryHandle GetSharedMemoryHandleForProcess( | |
| 57 base::ProcessHandle renderer_process); | |
| 58 | 56 |
| 59 // Returns a new mojo::ScopedSharedBufferHandle of the gamepad data. | 57 // Returns a new mojo::ScopedSharedBufferHandle of the gamepad data. |
| 60 mojo::ScopedSharedBufferHandle GetSharedBufferHandle(); | 58 mojo::ScopedSharedBufferHandle GetSharedBufferHandle(); |
| 61 | 59 |
| 62 void AddGamepadDataFetcher(GamepadDataFetcher* fetcher); | 60 void AddGamepadDataFetcher(GamepadDataFetcher* fetcher); |
| 63 void RemoveGamepadDataFetcher(GamepadDataFetcher* fetcher); | 61 void RemoveGamepadDataFetcher(GamepadDataFetcher* fetcher); |
| 64 | 62 |
| 65 void GetCurrentGamepadData(Gamepads* data); | 63 void GetCurrentGamepadData(Gamepads* data); |
| 66 | 64 |
| 67 // Pause and resume the background polling thread. Can be called from any | 65 // Pause and resume the background polling thread. Can be called from any |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 157 std::unique_ptr<base::Thread> polling_thread_; | 155 std::unique_ptr<base::Thread> polling_thread_; |
| 158 | 156 |
| 159 GamepadConnectionChangeClient* connection_change_client_; | 157 GamepadConnectionChangeClient* connection_change_client_; |
| 160 | 158 |
| 161 DISALLOW_COPY_AND_ASSIGN(GamepadProvider); | 159 DISALLOW_COPY_AND_ASSIGN(GamepadProvider); |
| 162 }; | 160 }; |
| 163 | 161 |
| 164 } // namespace device | 162 } // namespace device |
| 165 | 163 |
| 166 #endif // DEVICE_GAMEPAD_GAMEPAD_PROVIDER_H_ | 164 #endif // DEVICE_GAMEPAD_GAMEPAD_PROVIDER_H_ |
| OLD | NEW |