| 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 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 58 | 58 |
| 59 RTCDTMFSender::RTCDTMFSender(ExecutionContext* context, MediaStreamTrack* track,
PassOwnPtr<WebRTCDTMFSenderHandler> handler) | 59 RTCDTMFSender::RTCDTMFSender(ExecutionContext* context, MediaStreamTrack* track,
PassOwnPtr<WebRTCDTMFSenderHandler> handler) |
| 60 : ActiveDOMObject(context) | 60 : ActiveDOMObject(context) |
| 61 , m_track(track) | 61 , m_track(track) |
| 62 , m_duration(defaultToneDurationMs) | 62 , m_duration(defaultToneDurationMs) |
| 63 , m_interToneGap(defaultInterToneGapMs) | 63 , m_interToneGap(defaultInterToneGapMs) |
| 64 , m_handler(handler) | 64 , m_handler(handler) |
| 65 , m_stopped(false) | 65 , m_stopped(false) |
| 66 , m_scheduledEventTimer(this, &RTCDTMFSender::scheduledEventTimerFired) | 66 , m_scheduledEventTimer(this, &RTCDTMFSender::scheduledEventTimerFired) |
| 67 { | 67 { |
| 68 ThreadState::current()->registerPreFinalizer(this); |
| 68 m_handler->setClient(this); | 69 m_handler->setClient(this); |
| 69 } | 70 } |
| 70 | 71 |
| 71 RTCDTMFSender::~RTCDTMFSender() | 72 RTCDTMFSender::~RTCDTMFSender() |
| 72 { | 73 { |
| 73 } | 74 } |
| 74 | 75 |
| 76 void RTCDTMFSender::dispose() |
| 77 { |
| 78 m_handler->setClient(nullptr); |
| 79 m_handler.clear(); |
| 80 } |
| 81 |
| 75 bool RTCDTMFSender::canInsertDTMF() const | 82 bool RTCDTMFSender::canInsertDTMF() const |
| 76 { | 83 { |
| 77 return m_handler->canInsertDTMF(); | 84 return m_handler->canInsertDTMF(); |
| 78 } | 85 } |
| 79 | 86 |
| 80 MediaStreamTrack* RTCDTMFSender::track() const | 87 MediaStreamTrack* RTCDTMFSender::track() const |
| 81 { | 88 { |
| 82 return m_track.get(); | 89 return m_track.get(); |
| 83 } | 90 } |
| 84 | 91 |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 132 } | 139 } |
| 133 | 140 |
| 134 ExecutionContext* RTCDTMFSender::getExecutionContext() const | 141 ExecutionContext* RTCDTMFSender::getExecutionContext() const |
| 135 { | 142 { |
| 136 return ActiveDOMObject::getExecutionContext(); | 143 return ActiveDOMObject::getExecutionContext(); |
| 137 } | 144 } |
| 138 | 145 |
| 139 void RTCDTMFSender::stop() | 146 void RTCDTMFSender::stop() |
| 140 { | 147 { |
| 141 m_stopped = true; | 148 m_stopped = true; |
| 142 m_handler->setClient(0); | 149 m_handler->setClient(nullptr); |
| 143 } | 150 } |
| 144 | 151 |
| 145 void RTCDTMFSender::scheduleDispatchEvent(Event* event) | 152 void RTCDTMFSender::scheduleDispatchEvent(Event* event) |
| 146 { | 153 { |
| 147 m_scheduledEvents.append(event); | 154 m_scheduledEvents.append(event); |
| 148 | 155 |
| 149 if (!m_scheduledEventTimer.isActive()) | 156 if (!m_scheduledEventTimer.isActive()) |
| 150 m_scheduledEventTimer.startOneShot(0, BLINK_FROM_HERE); | 157 m_scheduledEventTimer.startOneShot(0, BLINK_FROM_HERE); |
| 151 } | 158 } |
| 152 | 159 |
| (...skipping 12 matching lines...) Expand all Loading... |
| 165 | 172 |
| 166 DEFINE_TRACE(RTCDTMFSender) | 173 DEFINE_TRACE(RTCDTMFSender) |
| 167 { | 174 { |
| 168 visitor->trace(m_track); | 175 visitor->trace(m_track); |
| 169 visitor->trace(m_scheduledEvents); | 176 visitor->trace(m_scheduledEvents); |
| 170 RefCountedGarbageCollectedEventTargetWithInlineData<RTCDTMFSender>::trace(vi
sitor); | 177 RefCountedGarbageCollectedEventTargetWithInlineData<RTCDTMFSender>::trace(vi
sitor); |
| 171 ActiveDOMObject::trace(visitor); | 178 ActiveDOMObject::trace(visitor); |
| 172 } | 179 } |
| 173 | 180 |
| 174 } // namespace blink | 181 } // namespace blink |
| OLD | NEW |