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 // TODO(heke) Change to mojo::ScopedSharedBufferHandle GetSharedBufferHandle() |
| 62 // See crbug/671928 for details. |
| 63 // Returns the shared memory handle of the gamepad data. |
| 64 base::SharedMemoryHandle GetSharedMemoryHandle(); |
| 65 |
61 void AddGamepadDataFetcher(GamepadDataFetcher* fetcher); | 66 void AddGamepadDataFetcher(GamepadDataFetcher* fetcher); |
62 void RemoveGamepadDataFetcher(GamepadDataFetcher* fetcher); | 67 void RemoveGamepadDataFetcher(GamepadDataFetcher* fetcher); |
63 | 68 |
64 void GetCurrentGamepadData(blink::WebGamepads* data); | 69 void GetCurrentGamepadData(blink::WebGamepads* data); |
65 | 70 |
66 // Pause and resume the background polling thread. Can be called from any | 71 // Pause and resume the background polling thread. Can be called from any |
67 // thread. | 72 // thread. |
68 void Pause(); | 73 void Pause(); |
69 void Resume(); | 74 void Resume(); |
70 | 75 |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
158 std::unique_ptr<base::Thread> polling_thread_; | 163 std::unique_ptr<base::Thread> polling_thread_; |
159 | 164 |
160 GamepadConnectionChangeClient* connection_change_client_; | 165 GamepadConnectionChangeClient* connection_change_client_; |
161 | 166 |
162 DISALLOW_COPY_AND_ASSIGN(GamepadProvider); | 167 DISALLOW_COPY_AND_ASSIGN(GamepadProvider); |
163 }; | 168 }; |
164 | 169 |
165 } // namespace device | 170 } // namespace device |
166 | 171 |
167 #endif // DEVICE_GAMEPAD_GAMEPAD_PROVIDER_H_ | 172 #endif // DEVICE_GAMEPAD_GAMEPAD_PROVIDER_H_ |
OLD | NEW |