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

Side by Side Diff: Source/modules/mediastream/RTCDTMFSender.cpp

Issue 18548003: Rename ExceptionCode constants to use the names in the spec (2/3) (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 5 months 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 | Annotate | Revision Log
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 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
99 } 99 }
100 100
101 void RTCDTMFSender::insertDTMF(const String& tones, long duration, long interTon eGap, ExceptionCode& ec) 101 void RTCDTMFSender::insertDTMF(const String& tones, long duration, long interTon eGap, ExceptionCode& ec)
102 { 102 {
103 if (!canInsertDTMF()) { 103 if (!canInsertDTMF()) {
104 ec = NotSupportedError; 104 ec = NotSupportedError;
105 return; 105 return;
106 } 106 }
107 107
108 if (duration > maxToneDurationMs || duration < minToneDurationMs) { 108 if (duration > maxToneDurationMs || duration < minToneDurationMs) {
109 ec = SYNTAX_ERR; 109 ec = SyntaxError;
110 return; 110 return;
111 } 111 }
112 112
113 if (interToneGap < minInterToneGapMs) { 113 if (interToneGap < minInterToneGapMs) {
114 ec = SYNTAX_ERR; 114 ec = SyntaxError;
115 return; 115 return;
116 } 116 }
117 117
118 m_duration = duration; 118 m_duration = duration;
119 m_interToneGap = interToneGap; 119 m_interToneGap = interToneGap;
120 120
121 if (!m_handler->insertDTMF(tones, m_duration, m_interToneGap)) 121 if (!m_handler->insertDTMF(tones, m_duration, m_interToneGap))
122 ec = SYNTAX_ERR; 122 ec = SyntaxError;
123 } 123 }
124 124
125 void RTCDTMFSender::didPlayTone(const String& tone) 125 void RTCDTMFSender::didPlayTone(const String& tone)
126 { 126 {
127 scheduleDispatchEvent(RTCDTMFToneChangeEvent::create(tone)); 127 scheduleDispatchEvent(RTCDTMFToneChangeEvent::create(tone));
128 } 128 }
129 129
130 const AtomicString& RTCDTMFSender::interfaceName() const 130 const AtomicString& RTCDTMFSender::interfaceName() const
131 { 131 {
132 return eventNames().interfaceForRTCDTMFSender; 132 return eventNames().interfaceForRTCDTMFSender;
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
168 168
169 Vector<RefPtr<Event> > events; 169 Vector<RefPtr<Event> > events;
170 events.swap(m_scheduledEvents); 170 events.swap(m_scheduledEvents);
171 171
172 Vector<RefPtr<Event> >::iterator it = events.begin(); 172 Vector<RefPtr<Event> >::iterator it = events.begin();
173 for (; it != events.end(); ++it) 173 for (; it != events.end(); ++it)
174 dispatchEvent((*it).release()); 174 dispatchEvent((*it).release());
175 } 175 }
176 176
177 } // namespace WebCore 177 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/modules/mediastream/MediaStream.cpp ('k') | Source/modules/mediastream/RTCDataChannel.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698