Changeset 65924 in webkit
- Timestamp:
- Aug 24, 2010 12:52:25 PM (14 years ago)
- Location:
- trunk/WebCore
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebCore/ChangeLog
r65921 r65924 1 2010-08-24 Hans Wennborg <hans@chromium.org> 2 3 Reviewed by Steve Block. 4 5 Remove null-checks from DeviceOrientationController 6 https://bugs.webkit.org/show_bug.cgi?id=44504 7 8 Remove checks for m_client being NULL from DeviceOrientationController. 9 It will never be NULL, and this is checked by an ASSERT on construction. 10 11 Will be covered by layout tests for device orientation. 12 13 * dom/DeviceOrientationController.cpp: 14 (WebCore::DeviceOrientationController::timerFired): 15 (WebCore::DeviceOrientationController::addListener): 16 (WebCore::DeviceOrientationController::removeListener): 17 (WebCore::DeviceOrientationController::removeAllListeners): 18 1 19 2010-08-24 Stephen White <senorblanco@chromium.org> 2 20 -
trunk/WebCore/dom/DeviceOrientationController.cpp
r64356 r65924 45 45 { 46 46 ASSERT_UNUSED(timer, timer == &m_timer); 47 ASSERT( !m_client ||m_client->lastOrientation());47 ASSERT(m_client->lastOrientation()); 48 48 49 RefPtr<DeviceOrientation> orientation = m_client ? m_client->lastOrientation() : DeviceOrientation::create();49 RefPtr<DeviceOrientation> orientation = m_client->lastOrientation(); 50 50 RefPtr<DeviceOrientationEvent> event = DeviceOrientationEvent::create(eventNames().deviceorientationEvent, orientation.get()); 51 51 … … 59 59 void DeviceOrientationController::addListener(DOMWindow* window) 60 60 { 61 // If no client is present, we should fire an event with all parameters null. If 62 // the client already has an orientation, we should fire an event with that 63 // orientation. In both cases, the event is fired asynchronously, but without 61 // If the client already has an orientation, we should fire an event with that 62 // orientation. The event is fired asynchronously, but without 64 63 // waiting for the client to get a new orientation. 65 if ( !m_client ||m_client->lastOrientation()) {64 if (m_client->lastOrientation()) { 66 65 m_newListeners.add(window); 67 66 if (!m_timer.isActive()) … … 72 71 bool wasEmpty = m_listeners.isEmpty(); 73 72 m_listeners.add(window); 74 if (wasEmpty && m_client)73 if (wasEmpty) 75 74 m_client->startUpdating(); 76 75 } … … 80 79 m_listeners.remove(window); 81 80 m_newListeners.remove(window); 82 if (m_listeners.isEmpty() && m_client)81 if (m_listeners.isEmpty()) 83 82 m_client->stopUpdating(); 84 83 } … … 92 91 m_listeners.removeAll(window); 93 92 m_newListeners.remove(window); 94 if (m_listeners.isEmpty() && m_client)93 if (m_listeners.isEmpty()) 95 94 m_client->stopUpdating(); 96 95 }
Note: See TracChangeset
for help on using the changeset viewer.