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

Side by Side Diff: Source/WebCore/dom/GenericEventQueue.cpp

Issue 10867074: Merge 124843 (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/1229/
Patch Set: Created 8 years, 3 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
« no previous file with comments | « LayoutTests/media/event-queue-crash-expected.txt ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
78 } 78 }
79 79
80 void GenericEventQueue::timerFired(Timer<GenericEventQueue>*) 80 void GenericEventQueue::timerFired(Timer<GenericEventQueue>*)
81 { 81 {
82 ASSERT(!m_timer.isActive()); 82 ASSERT(!m_timer.isActive());
83 ASSERT(!m_pendingEvents.isEmpty()); 83 ASSERT(!m_pendingEvents.isEmpty());
84 84
85 Vector<RefPtr<Event> > pendingEvents; 85 Vector<RefPtr<Event> > pendingEvents;
86 m_pendingEvents.swap(pendingEvents); 86 m_pendingEvents.swap(pendingEvents);
87 87
88 RefPtr<EventTarget> protect(m_owner);
88 for (unsigned i = 0; i < pendingEvents.size(); ++i) { 89 for (unsigned i = 0; i < pendingEvents.size(); ++i) {
89 EventTarget* target = pendingEvents[i]->target() ? pendingEvents[i]->tar get() : m_owner; 90 EventTarget* target = pendingEvents[i]->target() ? pendingEvents[i]->tar get() : m_owner;
90 target->dispatchEvent(pendingEvents[i].release()); 91 target->dispatchEvent(pendingEvents[i].release());
91 } 92 }
92 } 93 }
93 94
94 void GenericEventQueue::close() 95 void GenericEventQueue::close()
95 { 96 {
96 m_isClosed = true; 97 m_isClosed = true;
97 98
98 m_timer.stop(); 99 m_timer.stop();
99 m_pendingEvents.clear(); 100 m_pendingEvents.clear();
100 } 101 }
101 102
102 void GenericEventQueue::cancelAllEvents() 103 void GenericEventQueue::cancelAllEvents()
103 { 104 {
104 m_timer.stop(); 105 m_timer.stop();
105 m_pendingEvents.clear(); 106 m_pendingEvents.clear();
106 } 107 }
107 108
108 bool GenericEventQueue::hasPendingEvents() const 109 bool GenericEventQueue::hasPendingEvents() const
109 { 110 {
110 return m_pendingEvents.size(); 111 return m_pendingEvents.size();
111 } 112 }
112 113
113 } 114 }
OLDNEW
« no previous file with comments | « LayoutTests/media/event-queue-crash-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698