| 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 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 69 RTCDTMFSender::RTCDTMFSender(ExecutionContext* context, | 69 RTCDTMFSender::RTCDTMFSender(ExecutionContext* context, |
| 70 MediaStreamTrack* track, | 70 MediaStreamTrack* track, |
| 71 std::unique_ptr<WebRTCDTMFSenderHandler> handler) | 71 std::unique_ptr<WebRTCDTMFSenderHandler> handler) |
| 72 : SuspendableObject(context), | 72 : SuspendableObject(context), |
| 73 m_track(track), | 73 m_track(track), |
| 74 m_duration(defaultToneDurationMs), | 74 m_duration(defaultToneDurationMs), |
| 75 m_interToneGap(defaultInterToneGapMs), | 75 m_interToneGap(defaultInterToneGapMs), |
| 76 m_handler(std::move(handler)), | 76 m_handler(std::move(handler)), |
| 77 m_stopped(false), | 77 m_stopped(false), |
| 78 m_scheduledEventTimer(this, &RTCDTMFSender::scheduledEventTimerFired) { | 78 m_scheduledEventTimer(this, &RTCDTMFSender::scheduledEventTimerFired) { |
| 79 ThreadState::current()->registerPreFinalizer(this); | |
| 80 m_handler->setClient(this); | 79 m_handler->setClient(this); |
| 81 } | 80 } |
| 82 | 81 |
| 83 RTCDTMFSender::~RTCDTMFSender() {} | 82 RTCDTMFSender::~RTCDTMFSender() {} |
| 84 | 83 |
| 85 void RTCDTMFSender::dispose() { | 84 void RTCDTMFSender::dispose() { |
| 86 // Promptly clears a raw reference from content/ to an on-heap object | 85 // Promptly clears a raw reference from content/ to an on-heap object |
| 87 // so that content/ doesn't access it in a lazy sweeping phase. | 86 // so that content/ doesn't access it in a lazy sweeping phase. |
| 88 m_handler->setClient(nullptr); | 87 m_handler->setClient(nullptr); |
| 89 m_handler.reset(); | 88 m_handler.reset(); |
| (...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 185 } | 184 } |
| 186 | 185 |
| 187 DEFINE_TRACE(RTCDTMFSender) { | 186 DEFINE_TRACE(RTCDTMFSender) { |
| 188 visitor->trace(m_track); | 187 visitor->trace(m_track); |
| 189 visitor->trace(m_scheduledEvents); | 188 visitor->trace(m_scheduledEvents); |
| 190 EventTargetWithInlineData::trace(visitor); | 189 EventTargetWithInlineData::trace(visitor); |
| 191 SuspendableObject::trace(visitor); | 190 SuspendableObject::trace(visitor); |
| 192 } | 191 } |
| 193 | 192 |
| 194 } // namespace blink | 193 } // namespace blink |
| OLD | NEW |