| 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 11 matching lines...) Expand all Loading... |
| 22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 24 */ | 24 */ |
| 25 | 25 |
| 26 #include "modules/peerconnection/RTCDTMFSender.h" | 26 #include "modules/peerconnection/RTCDTMFSender.h" |
| 27 | 27 |
| 28 #include "bindings/core/v8/ExceptionMessages.h" | 28 #include "bindings/core/v8/ExceptionMessages.h" |
| 29 #include "bindings/core/v8/ExceptionState.h" | 29 #include "bindings/core/v8/ExceptionState.h" |
| 30 #include "core/dom/ExceptionCode.h" | 30 #include "core/dom/ExceptionCode.h" |
| 31 #include "core/dom/ExecutionContext.h" | 31 #include "core/dom/ExecutionContext.h" |
| 32 #include "core/dom/TaskRunnerHelper.h" |
| 32 #include "modules/mediastream/MediaStreamTrack.h" | 33 #include "modules/mediastream/MediaStreamTrack.h" |
| 33 #include "modules/peerconnection/RTCDTMFToneChangeEvent.h" | 34 #include "modules/peerconnection/RTCDTMFToneChangeEvent.h" |
| 34 #include "public/platform/WebMediaStreamTrack.h" | 35 #include "public/platform/WebMediaStreamTrack.h" |
| 35 #include "public/platform/WebRTCDTMFSenderHandler.h" | 36 #include "public/platform/WebRTCDTMFSenderHandler.h" |
| 36 #include "public/platform/WebRTCPeerConnectionHandler.h" | 37 #include "public/platform/WebRTCPeerConnectionHandler.h" |
| 37 #include "wtf/PtrUtil.h" | 38 #include "wtf/PtrUtil.h" |
| 38 #include <memory> | 39 #include <memory> |
| 39 | 40 |
| 40 namespace blink { | 41 namespace blink { |
| 41 | 42 |
| (...skipping 23 matching lines...) Expand all Loading... |
| 65 | 66 |
| 66 RTCDTMFSender::RTCDTMFSender(ExecutionContext* context, | 67 RTCDTMFSender::RTCDTMFSender(ExecutionContext* context, |
| 67 MediaStreamTrack* track, | 68 MediaStreamTrack* track, |
| 68 std::unique_ptr<WebRTCDTMFSenderHandler> handler) | 69 std::unique_ptr<WebRTCDTMFSenderHandler> handler) |
| 69 : ContextLifecycleObserver(context), | 70 : ContextLifecycleObserver(context), |
| 70 m_track(track), | 71 m_track(track), |
| 71 m_duration(defaultToneDurationMs), | 72 m_duration(defaultToneDurationMs), |
| 72 m_interToneGap(defaultInterToneGapMs), | 73 m_interToneGap(defaultInterToneGapMs), |
| 73 m_handler(std::move(handler)), | 74 m_handler(std::move(handler)), |
| 74 m_stopped(false), | 75 m_stopped(false), |
| 75 m_scheduledEventTimer(this, &RTCDTMFSender::scheduledEventTimerFired) { | 76 m_scheduledEventTimer( |
| 77 TaskRunnerHelper::get(TaskType::Networking, context), |
| 78 this, |
| 79 &RTCDTMFSender::scheduledEventTimerFired) { |
| 76 m_handler->setClient(this); | 80 m_handler->setClient(this); |
| 77 } | 81 } |
| 78 | 82 |
| 79 RTCDTMFSender::~RTCDTMFSender() {} | 83 RTCDTMFSender::~RTCDTMFSender() {} |
| 80 | 84 |
| 81 void RTCDTMFSender::dispose() { | 85 void RTCDTMFSender::dispose() { |
| 82 // Promptly clears a raw reference from content/ to an on-heap object | 86 // Promptly clears a raw reference from content/ to an on-heap object |
| 83 // so that content/ doesn't access it in a lazy sweeping phase. | 87 // so that content/ doesn't access it in a lazy sweeping phase. |
| 84 m_handler->setClient(nullptr); | 88 m_handler->setClient(nullptr); |
| 85 m_handler.reset(); | 89 m_handler.reset(); |
| (...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 181 } | 185 } |
| 182 | 186 |
| 183 DEFINE_TRACE(RTCDTMFSender) { | 187 DEFINE_TRACE(RTCDTMFSender) { |
| 184 visitor->trace(m_track); | 188 visitor->trace(m_track); |
| 185 visitor->trace(m_scheduledEvents); | 189 visitor->trace(m_scheduledEvents); |
| 186 EventTargetWithInlineData::trace(visitor); | 190 EventTargetWithInlineData::trace(visitor); |
| 187 ContextLifecycleObserver::trace(visitor); | 191 ContextLifecycleObserver::trace(visitor); |
| 188 } | 192 } |
| 189 | 193 |
| 190 } // namespace blink | 194 } // namespace blink |
| OLD | NEW |