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

Side by Side Diff: third_party/WebKit/Source/modules/webaudio/MediaStreamAudioDestinationNode.cpp

Issue 2159403002: Replace ASSERT with DCHECK in WebAudio (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 4 years, 4 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2012, Google Inc. All rights reserved. 2 * Copyright (C) 2012, 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
69 { 69 {
70 // Conform the input bus into the internal mix bus, which represents 70 // Conform the input bus into the internal mix bus, which represents
71 // MediaStreamDestination's channel count. 71 // MediaStreamDestination's channel count.
72 m_mixBus->copyFrom(*input(0).bus()); 72 m_mixBus->copyFrom(*input(0).bus());
73 73
74 m_source->consumeAudio(m_mixBus.get(), numberOfFrames); 74 m_source->consumeAudio(m_mixBus.get(), numberOfFrames);
75 } 75 }
76 76
77 void MediaStreamAudioDestinationHandler::setChannelCount(unsigned long channelCo unt, ExceptionState& exceptionState) 77 void MediaStreamAudioDestinationHandler::setChannelCount(unsigned long channelCo unt, ExceptionState& exceptionState)
78 { 78 {
79 ASSERT(isMainThread()); 79 DCHECK(isMainThread());
80 80
81 // Currently the maximum channel count supported for this node is 8, 81 // Currently the maximum channel count supported for this node is 8,
82 // which is constrained by m_source (WebAudioCapturereSource). Although 82 // which is constrained by m_source (WebAudioCapturereSource). Although
83 // it has its own safety check for the excessive channels, throwing an 83 // it has its own safety check for the excessive channels, throwing an
84 // exception here is useful to developers. 84 // exception here is useful to developers.
85 if (channelCount > maxChannelCount()) { 85 if (channelCount > maxChannelCount()) {
86 exceptionState.throwDOMException( 86 exceptionState.throwDOMException(
87 IndexSizeError, 87 IndexSizeError,
88 ExceptionMessages::indexOutsideRange<unsigned>("channel count", 88 ExceptionMessages::indexOutsideRange<unsigned>("channel count",
89 channelCount, 89 channelCount,
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
134 return new MediaStreamAudioDestinationNode(context, numberOfChannels); 134 return new MediaStreamAudioDestinationNode(context, numberOfChannels);
135 } 135 }
136 136
137 MediaStream* MediaStreamAudioDestinationNode::stream() const 137 MediaStream* MediaStreamAudioDestinationNode::stream() const
138 { 138 {
139 return static_cast<MediaStreamAudioDestinationHandler&>(handler()).stream(); 139 return static_cast<MediaStreamAudioDestinationHandler&>(handler()).stream();
140 } 140 }
141 141
142 } // namespace blink 142 } // namespace blink
143 143
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698