Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(215)

Side by Side Diff: third_party/WebKit/Source/modules/peerconnection/RTCDTMFSender.cpp

Issue 2567913002: Rename ActiveDOMObject to SuspendableObject (Closed)
Patch Set: Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
62 62
63 RTCDTMFSender* dtmfSender = 63 RTCDTMFSender* dtmfSender =
64 new RTCDTMFSender(context, track, std::move(handler)); 64 new RTCDTMFSender(context, track, std::move(handler));
65 dtmfSender->suspendIfNeeded(); 65 dtmfSender->suspendIfNeeded();
66 return dtmfSender; 66 return dtmfSender;
67 } 67 }
68 68
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 : ActiveDOMObject(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); 79 ThreadState::current()->registerPreFinalizer(this);
80 m_handler->setClient(this); 80 m_handler->setClient(this);
81 } 81 }
82 82
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
150 150
151 void RTCDTMFSender::didPlayTone(const WebString& tone) { 151 void RTCDTMFSender::didPlayTone(const WebString& tone) {
152 scheduleDispatchEvent(RTCDTMFToneChangeEvent::create(tone)); 152 scheduleDispatchEvent(RTCDTMFToneChangeEvent::create(tone));
153 } 153 }
154 154
155 const AtomicString& RTCDTMFSender::interfaceName() const { 155 const AtomicString& RTCDTMFSender::interfaceName() const {
156 return EventTargetNames::RTCDTMFSender; 156 return EventTargetNames::RTCDTMFSender;
157 } 157 }
158 158
159 ExecutionContext* RTCDTMFSender::getExecutionContext() const { 159 ExecutionContext* RTCDTMFSender::getExecutionContext() const {
160 return ActiveDOMObject::getExecutionContext(); 160 return SuspendableObject::getExecutionContext();
161 } 161 }
162 162
163 void RTCDTMFSender::contextDestroyed() { 163 void RTCDTMFSender::contextDestroyed() {
164 m_stopped = true; 164 m_stopped = true;
165 m_handler->setClient(nullptr); 165 m_handler->setClient(nullptr);
166 } 166 }
167 167
168 void RTCDTMFSender::scheduleDispatchEvent(Event* event) { 168 void RTCDTMFSender::scheduleDispatchEvent(Event* event) {
169 m_scheduledEvents.append(event); 169 m_scheduledEvents.append(event);
170 170
(...skipping 10 matching lines...) Expand all
181 181
182 HeapVector<Member<Event>>::iterator it = events.begin(); 182 HeapVector<Member<Event>>::iterator it = events.begin();
183 for (; it != events.end(); ++it) 183 for (; it != events.end(); ++it)
184 dispatchEvent((*it).release()); 184 dispatchEvent((*it).release());
185 } 185 }
186 186
187 DEFINE_TRACE(RTCDTMFSender) { 187 DEFINE_TRACE(RTCDTMFSender) {
188 visitor->trace(m_track); 188 visitor->trace(m_track);
189 visitor->trace(m_scheduledEvents); 189 visitor->trace(m_scheduledEvents);
190 EventTargetWithInlineData::trace(visitor); 190 EventTargetWithInlineData::trace(visitor);
191 ActiveDOMObject::trace(visitor); 191 SuspendableObject::trace(visitor);
192 } 192 }
193 193
194 } // namespace blink 194 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698