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

Side by Side Diff: Source/core/events/GenericEventQueue.cpp

Issue 316443004: Oilpan: Remove ref counting from EventTarget and all uses of Pass/RefPtr<EventTarget>. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: rebase Created 6 years, 6 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
« no previous file with comments | « Source/core/events/FocusEvent.cpp ('k') | Source/core/events/MessageEvent.h » ('j') | 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 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
81 } 81 }
82 82
83 void GenericEventQueue::timerFired(Timer<GenericEventQueue>*) 83 void GenericEventQueue::timerFired(Timer<GenericEventQueue>*)
84 { 84 {
85 ASSERT(!m_timer.isActive()); 85 ASSERT(!m_timer.isActive());
86 ASSERT(!m_pendingEvents.isEmpty()); 86 ASSERT(!m_pendingEvents.isEmpty());
87 87
88 WillBeHeapVector<RefPtrWillBeMember<Event> > pendingEvents; 88 WillBeHeapVector<RefPtrWillBeMember<Event> > pendingEvents;
89 m_pendingEvents.swap(pendingEvents); 89 m_pendingEvents.swap(pendingEvents);
90 90
91 RefPtr<EventTarget> protect(m_owner); 91 RefPtrWillBeRawPtr<EventTarget> protect(m_owner);
92 for (size_t i = 0; i < pendingEvents.size(); ++i) { 92 for (size_t i = 0; i < pendingEvents.size(); ++i) {
93 Event* event = pendingEvents[i].get(); 93 Event* event = pendingEvents[i].get();
94 EventTarget* target = event->target() ? event->target() : m_owner; 94 EventTarget* target = event->target() ? event->target() : m_owner;
95 CString type(event->type().ascii()); 95 CString type(event->type().ascii());
96 TRACE_EVENT_ASYNC_STEP_INTO1("event", "GenericEventQueue:enqueueEvent", event, "dispatch", "type", type); 96 TRACE_EVENT_ASYNC_STEP_INTO1("event", "GenericEventQueue:enqueueEvent", event, "dispatch", "type", type);
97 target->dispatchEvent(pendingEvents[i].release()); 97 target->dispatchEvent(pendingEvents[i].release());
98 TRACE_EVENT_ASYNC_END1("event", "GenericEventQueue:enqueueEvent", event, "type", type); 98 TRACE_EVENT_ASYNC_END1("event", "GenericEventQueue:enqueueEvent", event, "type", type);
99 } 99 }
100 } 100 }
101 101
(...skipping 13 matching lines...) Expand all
115 } 115 }
116 m_pendingEvents.clear(); 116 m_pendingEvents.clear();
117 } 117 }
118 118
119 bool GenericEventQueue::hasPendingEvents() const 119 bool GenericEventQueue::hasPendingEvents() const
120 { 120 {
121 return m_pendingEvents.size(); 121 return m_pendingEvents.size();
122 } 122 }
123 123
124 } 124 }
OLDNEW
« no previous file with comments | « Source/core/events/FocusEvent.cpp ('k') | Source/core/events/MessageEvent.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698