| 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 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 45 static const long defaultInterToneGapMs = 50; | 45 static const long defaultInterToneGapMs = 50; |
| 46 | 46 |
| 47 RTCDTMFSender* RTCDTMFSender::create(ExecutionContext* context, WebRTCPeerConnec
tionHandler* peerConnectionHandler, MediaStreamTrack* track, ExceptionState& exc
eptionState) | 47 RTCDTMFSender* RTCDTMFSender::create(ExecutionContext* context, WebRTCPeerConnec
tionHandler* peerConnectionHandler, MediaStreamTrack* track, ExceptionState& exc
eptionState) |
| 48 { | 48 { |
| 49 OwnPtr<WebRTCDTMFSenderHandler> handler = adoptPtr(peerConnectionHandler->cr
eateDTMFSender(track->component())); | 49 OwnPtr<WebRTCDTMFSenderHandler> handler = adoptPtr(peerConnectionHandler->cr
eateDTMFSender(track->component())); |
| 50 if (!handler) { | 50 if (!handler) { |
| 51 exceptionState.throwDOMException(NotSupportedError, "The MediaStreamTrac
k provided is not an element of a MediaStream that's currently in the local stre
ams set."); | 51 exceptionState.throwDOMException(NotSupportedError, "The MediaStreamTrac
k provided is not an element of a MediaStream that's currently in the local stre
ams set."); |
| 52 return nullptr; | 52 return nullptr; |
| 53 } | 53 } |
| 54 | 54 |
| 55 RTCDTMFSender* dtmfSender = adoptRefCountedGarbageCollectedWillBeNoop(new RT
CDTMFSender(context, track, handler.release())); | 55 RTCDTMFSender* dtmfSender = new RTCDTMFSender(context, track, handler.releas
e()); |
| 56 dtmfSender->suspendIfNeeded(); | 56 dtmfSender->suspendIfNeeded(); |
| 57 return dtmfSender; | 57 return dtmfSender; |
| 58 } | 58 } |
| 59 | 59 |
| 60 RTCDTMFSender::RTCDTMFSender(ExecutionContext* context, MediaStreamTrack* track,
PassOwnPtr<WebRTCDTMFSenderHandler> handler) | 60 RTCDTMFSender::RTCDTMFSender(ExecutionContext* context, MediaStreamTrack* track,
PassOwnPtr<WebRTCDTMFSenderHandler> handler) |
| 61 : ActiveDOMObject(context) | 61 : ActiveDOMObject(context) |
| 62 , m_track(track) | 62 , m_track(track) |
| 63 , m_duration(defaultToneDurationMs) | 63 , m_duration(defaultToneDurationMs) |
| 64 , m_interToneGap(defaultInterToneGapMs) | 64 , m_interToneGap(defaultInterToneGapMs) |
| 65 , m_handler(handler) | 65 , m_handler(handler) |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 165 } | 165 } |
| 166 | 166 |
| 167 void RTCDTMFSender::trace(Visitor* visitor) | 167 void RTCDTMFSender::trace(Visitor* visitor) |
| 168 { | 168 { |
| 169 visitor->trace(m_track); | 169 visitor->trace(m_track); |
| 170 visitor->trace(m_scheduledEvents); | 170 visitor->trace(m_scheduledEvents); |
| 171 EventTargetWithInlineData::trace(visitor); | 171 EventTargetWithInlineData::trace(visitor); |
| 172 } | 172 } |
| 173 | 173 |
| 174 } // namespace blink | 174 } // namespace blink |
| OLD | NEW |