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

Side by Side Diff: Source/modules/mediastream/RTCDTMFSender.cpp

Issue 26878003: Reduce repetitive EventTarget subclassing (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fix nit Created 7 years, 2 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/modules/mediastream/RTCDTMFSender.h ('k') | Source/modules/mediastream/RTCDataChannel.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) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 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 125 matching lines...) Expand 10 before | Expand all | Expand 10 after
136 { 136 {
137 return ActiveDOMObject::scriptExecutionContext(); 137 return ActiveDOMObject::scriptExecutionContext();
138 } 138 }
139 139
140 void RTCDTMFSender::stop() 140 void RTCDTMFSender::stop()
141 { 141 {
142 m_stopped = true; 142 m_stopped = true;
143 m_handler->setClient(0); 143 m_handler->setClient(0);
144 } 144 }
145 145
146 EventTargetData* RTCDTMFSender::eventTargetData()
147 {
148 return &m_eventTargetData;
149 }
150
151 EventTargetData* RTCDTMFSender::ensureEventTargetData()
152 {
153 return &m_eventTargetData;
154 }
155
156 void RTCDTMFSender::scheduleDispatchEvent(PassRefPtr<Event> event) 146 void RTCDTMFSender::scheduleDispatchEvent(PassRefPtr<Event> event)
157 { 147 {
158 m_scheduledEvents.append(event); 148 m_scheduledEvents.append(event);
159 149
160 if (!m_scheduledEventTimer.isActive()) 150 if (!m_scheduledEventTimer.isActive())
161 m_scheduledEventTimer.startOneShot(0); 151 m_scheduledEventTimer.startOneShot(0);
162 } 152 }
163 153
164 void RTCDTMFSender::scheduledEventTimerFired(Timer<RTCDTMFSender>*) 154 void RTCDTMFSender::scheduledEventTimerFired(Timer<RTCDTMFSender>*)
165 { 155 {
166 if (m_stopped) 156 if (m_stopped)
167 return; 157 return;
168 158
169 Vector<RefPtr<Event> > events; 159 Vector<RefPtr<Event> > events;
170 events.swap(m_scheduledEvents); 160 events.swap(m_scheduledEvents);
171 161
172 Vector<RefPtr<Event> >::iterator it = events.begin(); 162 Vector<RefPtr<Event> >::iterator it = events.begin();
173 for (; it != events.end(); ++it) 163 for (; it != events.end(); ++it)
174 dispatchEvent((*it).release()); 164 dispatchEvent((*it).release());
175 } 165 }
176 166
177 } // namespace WebCore 167 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/modules/mediastream/RTCDTMFSender.h ('k') | Source/modules/mediastream/RTCDataChannel.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698