OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2011, Google Inc. All rights reserved. | 2 * Copyright (C) 2011, Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are met: | 5 * modification, are permitted provided that the following conditions are met: |
6 * | 6 * |
7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
122 return m_gamepads.get(); | 122 return m_gamepads.get(); |
123 } | 123 } |
124 | 124 |
125 void NavigatorGamepad::trace(Visitor* visitor) | 125 void NavigatorGamepad::trace(Visitor* visitor) |
126 { | 126 { |
127 visitor->trace(m_gamepads); | 127 visitor->trace(m_gamepads); |
128 visitor->trace(m_webkitGamepads); | 128 visitor->trace(m_webkitGamepads); |
129 visitor->trace(m_pendingEvents); | 129 visitor->trace(m_pendingEvents); |
130 WillBeHeapSupplement<Navigator>::trace(visitor); | 130 WillBeHeapSupplement<Navigator>::trace(visitor); |
131 DOMWindowProperty::trace(visitor); | 131 DOMWindowProperty::trace(visitor); |
| 132 PlatformEventController::trace(visitor); |
132 } | 133 } |
133 | 134 |
134 void NavigatorGamepad::didUpdateData() | 135 void NavigatorGamepad::didUpdateData() |
135 { | 136 { |
136 // We should stop listening once we detached. | 137 // We should stop listening once we detached. |
137 ASSERT(window()); | 138 ASSERT(window()); |
138 | 139 |
139 // We register to the dispatcher before sampling gamepads so we need to chec
k if we actually have an event listener. | 140 // We register to the dispatcher before sampling gamepads so we need to chec
k if we actually have an event listener. |
140 if (!m_hasEventListener) | 141 if (!m_hasEventListener) |
141 return; | 142 return; |
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
288 if (connectedGamepadChanged || (!oldWasConnected && newIsConnected)) { | 289 if (connectedGamepadChanged || (!oldWasConnected && newIsConnected)) { |
289 m_pendingEvents.append(newGamepad); | 290 m_pendingEvents.append(newGamepad); |
290 } | 291 } |
291 } | 292 } |
292 | 293 |
293 if (!m_pendingEvents.isEmpty()) | 294 if (!m_pendingEvents.isEmpty()) |
294 m_dispatchOneEventRunner.runAsync(); | 295 m_dispatchOneEventRunner.runAsync(); |
295 } | 296 } |
296 | 297 |
297 } // namespace blink | 298 } // namespace blink |
OLD | NEW |