OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2012 Victor Carbune (victor@rosedu.org) | 2 * Copyright (C) 2012 Victor Carbune (victor@rosedu.org) |
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 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
45 | 45 |
46 GenericEventQueue::~GenericEventQueue() | 46 GenericEventQueue::~GenericEventQueue() |
47 { | 47 { |
48 } | 48 } |
49 | 49 |
50 bool GenericEventQueue::enqueueEvent(PassRefPtr<Event> event) | 50 bool GenericEventQueue::enqueueEvent(PassRefPtr<Event> event) |
51 { | 51 { |
52 if (m_isClosed) | 52 if (m_isClosed) |
53 return false; | 53 return false; |
54 | 54 |
55 ASSERT(event->target()); | |
56 if (event->target() == m_owner) | 55 if (event->target() == m_owner) |
57 event->setTarget(0); | 56 event->setTarget(0); |
58 | 57 |
59 m_pendingEvents.append(event); | 58 m_pendingEvents.append(event); |
60 | 59 |
61 if (!m_timer.isActive()) | 60 if (!m_timer.isActive()) |
62 m_timer.startOneShot(0); | 61 m_timer.startOneShot(0); |
63 | 62 |
64 return true; | 63 return true; |
65 } | 64 } |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
105 m_timer.stop(); | 104 m_timer.stop(); |
106 m_pendingEvents.clear(); | 105 m_pendingEvents.clear(); |
107 } | 106 } |
108 | 107 |
109 bool GenericEventQueue::hasPendingEvents() const | 108 bool GenericEventQueue::hasPendingEvents() const |
110 { | 109 { |
111 return m_pendingEvents.size(); | 110 return m_pendingEvents.size(); |
112 } | 111 } |
113 | 112 |
114 } | 113 } |
OLD | NEW |