Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(302)

Side by Side Diff: Source/modules/gamepad/NavigatorGamepad.cpp

Issue 216523002: Oilpan: Replace most of RefPtrs for Event objects with oilpan's transition types (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 131 matching lines...) Expand 10 before | Expand all | Expand 10 after
142 if (!m_gamepads) 142 if (!m_gamepads)
143 m_gamepads = GamepadList::create(); 143 m_gamepads = GamepadList::create();
144 144
145 RefPtrWillBeRawPtr<Gamepad> gamepad = m_gamepads->item(index); 145 RefPtrWillBeRawPtr<Gamepad> gamepad = m_gamepads->item(index);
146 if (!gamepad) 146 if (!gamepad)
147 gamepad = Gamepad::create(); 147 gamepad = Gamepad::create();
148 sampleGamepad(index, *gamepad, webGamepad); 148 sampleGamepad(index, *gamepad, webGamepad);
149 m_gamepads->set(index, gamepad); 149 m_gamepads->set(index, gamepad);
150 150
151 const AtomicString& eventName = connected ? EventTypeNames::gamepadconnected : EventTypeNames::gamepaddisconnected; 151 const AtomicString& eventName = connected ? EventTypeNames::gamepadconnected : EventTypeNames::gamepaddisconnected;
152 RefPtr<GamepadEvent> event = GamepadEvent::create(eventName, false, true, ga mepad.get()); 152 RefPtrWillBeRawPtr<GamepadEvent> event = GamepadEvent::create(eventName, fal se, true, gamepad.get());
153 window()->dispatchEvent(event); 153 window()->dispatchEvent(event);
154 } 154 }
155 155
156 NavigatorGamepad::NavigatorGamepad(Document& document) 156 NavigatorGamepad::NavigatorGamepad(Document& document)
157 : DOMWindowProperty(document.frame()) 157 : DOMWindowProperty(document.frame())
158 , DeviceSensorEventController(document) 158 , DeviceSensorEventController(document)
159 , DOMWindowLifecycleObserver(document.frame()->domWindow()) 159 , DOMWindowLifecycleObserver(document.frame()->domWindow())
160 { 160 {
161 } 161 }
162 162
(...skipping 27 matching lines...) Expand all
190 { 190 {
191 GamepadDispatcher::instance().removeClient(this); 191 GamepadDispatcher::instance().removeClient(this);
192 } 192 }
193 193
194 bool NavigatorGamepad::hasLastData() 194 bool NavigatorGamepad::hasLastData()
195 { 195 {
196 // Gamepad data is polled instead of pushed. 196 // Gamepad data is polled instead of pushed.
197 return false; 197 return false;
198 } 198 }
199 199
200 PassRefPtr<Event> NavigatorGamepad::getLastEvent() 200 PassRefPtrWillBeRawPtr<Event> NavigatorGamepad::getLastEvent()
201 { 201 {
202 // This is called only when hasLastData() is true. 202 // This is called only when hasLastData() is true.
203 ASSERT_NOT_REACHED(); 203 ASSERT_NOT_REACHED();
204 return nullptr; 204 return nullptr;
205 } 205 }
206 206
207 bool NavigatorGamepad::isNullEvent(Event*) 207 bool NavigatorGamepad::isNullEvent(Event*)
208 { 208 {
209 // This is called only when hasLastData() is true. 209 // This is called only when hasLastData() is true.
210 ASSERT_NOT_REACHED(); 210 ASSERT_NOT_REACHED();
(...skipping 14 matching lines...) Expand all
225 if (eventType == EventTypeNames::gamepadconnected || eventType == EventTypeN ames::gamepaddisconnected) 225 if (eventType == EventTypeNames::gamepadconnected || eventType == EventTypeN ames::gamepaddisconnected)
226 m_hasEventListener = false; 226 m_hasEventListener = false;
227 } 227 }
228 228
229 void NavigatorGamepad::didRemoveAllEventListeners(DOMWindow*) 229 void NavigatorGamepad::didRemoveAllEventListeners(DOMWindow*)
230 { 230 {
231 m_hasEventListener = false; 231 m_hasEventListener = false;
232 } 232 }
233 233
234 } // namespace WebCore 234 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698