| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2010 Google Inc. All Rights Reserved. | 2 * Copyright (C) 2010 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 | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 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 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 66 bool DOMWindowEventQueue::enqueueEvent(PassRefPtr<Event> event) | 66 bool DOMWindowEventQueue::enqueueEvent(PassRefPtr<Event> event) |
| 67 { | 67 { |
| 68 if (m_isClosed) | 68 if (m_isClosed) |
| 69 return false; | 69 return false; |
| 70 | 70 |
| 71 ASSERT(event->target()); | 71 ASSERT(event->target()); |
| 72 bool wasAdded = m_queuedEvents.add(event).isNewEntry; | 72 bool wasAdded = m_queuedEvents.add(event).isNewEntry; |
| 73 ASSERT_UNUSED(wasAdded, wasAdded); // It should not have already been in the
list. | 73 ASSERT_UNUSED(wasAdded, wasAdded); // It should not have already been in the
list. |
| 74 | 74 |
| 75 if (!m_pendingEventTimer->isActive()) | 75 if (!m_pendingEventTimer->isActive()) |
| 76 m_pendingEventTimer->startOneShot(0); | 76 m_pendingEventTimer->startOneShot(0, FROM_HERE); |
| 77 | 77 |
| 78 return true; | 78 return true; |
| 79 } | 79 } |
| 80 | 80 |
| 81 bool DOMWindowEventQueue::cancelEvent(Event* event) | 81 bool DOMWindowEventQueue::cancelEvent(Event* event) |
| 82 { | 82 { |
| 83 ListHashSet<RefPtr<Event>, 16>::iterator it = m_queuedEvents.find(event); | 83 ListHashSet<RefPtr<Event>, 16>::iterator it = m_queuedEvents.find(event); |
| 84 bool found = it != m_queuedEvents.end(); | 84 bool found = it != m_queuedEvents.end(); |
| 85 if (found) | 85 if (found) |
| 86 m_queuedEvents.remove(it); | 86 m_queuedEvents.remove(it); |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 121 void DOMWindowEventQueue::dispatchEvent(PassRefPtr<Event> event) | 121 void DOMWindowEventQueue::dispatchEvent(PassRefPtr<Event> event) |
| 122 { | 122 { |
| 123 EventTarget* eventTarget = event->target(); | 123 EventTarget* eventTarget = event->target(); |
| 124 if (eventTarget->toDOMWindow()) | 124 if (eventTarget->toDOMWindow()) |
| 125 eventTarget->toDOMWindow()->dispatchEvent(event, nullptr); | 125 eventTarget->toDOMWindow()->dispatchEvent(event, nullptr); |
| 126 else | 126 else |
| 127 eventTarget->dispatchEvent(event); | 127 eventTarget->dispatchEvent(event); |
| 128 } | 128 } |
| 129 | 129 |
| 130 } | 130 } |
| OLD | NEW |