| 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 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 44 static const int defaultInterToneGapMs = 50; | 44 static const int defaultInterToneGapMs = 50; |
| 45 | 45 |
| 46 RTCDTMFSender* RTCDTMFSender::create(ExecutionContext* context, WebRTCPeerConnec
tionHandler* peerConnectionHandler, MediaStreamTrack* track, ExceptionState& exc
eptionState) | 46 RTCDTMFSender* RTCDTMFSender::create(ExecutionContext* context, WebRTCPeerConnec
tionHandler* peerConnectionHandler, MediaStreamTrack* track, ExceptionState& exc
eptionState) |
| 47 { | 47 { |
| 48 OwnPtr<WebRTCDTMFSenderHandler> handler = adoptPtr(peerConnectionHandler->cr
eateDTMFSender(track->component())); | 48 OwnPtr<WebRTCDTMFSenderHandler> handler = adoptPtr(peerConnectionHandler->cr
eateDTMFSender(track->component())); |
| 49 if (!handler) { | 49 if (!handler) { |
| 50 exceptionState.throwDOMException(NotSupportedError, "The MediaStreamTrac
k provided is not an element of a MediaStream that's currently in the local stre
ams set."); | 50 exceptionState.throwDOMException(NotSupportedError, "The MediaStreamTrac
k provided is not an element of a MediaStream that's currently in the local stre
ams set."); |
| 51 return nullptr; | 51 return nullptr; |
| 52 } | 52 } |
| 53 | 53 |
| 54 RTCDTMFSender* dtmfSender = new RTCDTMFSender(context, track, handler.releas
e()); | 54 RTCDTMFSender* dtmfSender = new RTCDTMFSender(context, track, std::move(hand
ler)); |
| 55 dtmfSender->suspendIfNeeded(); | 55 dtmfSender->suspendIfNeeded(); |
| 56 return dtmfSender; | 56 return dtmfSender; |
| 57 } | 57 } |
| 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(std::move(handler)) | 64 , m_handler(std::move(handler)) |
| (...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 174 | 174 |
| 175 DEFINE_TRACE(RTCDTMFSender) | 175 DEFINE_TRACE(RTCDTMFSender) |
| 176 { | 176 { |
| 177 visitor->trace(m_track); | 177 visitor->trace(m_track); |
| 178 visitor->trace(m_scheduledEvents); | 178 visitor->trace(m_scheduledEvents); |
| 179 EventTargetWithInlineData::trace(visitor); | 179 EventTargetWithInlineData::trace(visitor); |
| 180 ActiveDOMObject::trace(visitor); | 180 ActiveDOMObject::trace(visitor); |
| 181 } | 181 } |
| 182 | 182 |
| 183 } // namespace blink | 183 } // namespace blink |
| OLD | NEW |