| OLD | NEW |
| 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 Loading... |
| 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 |
| OLD | NEW |