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

Side by Side Diff: Source/modules/webaudio/MediaElementAudioSourceNode.cpp

Issue 906233002: Use nullptr instead of 0 in WebAudio (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: rebase Created 5 years, 10 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) 2011, Google Inc. All rights reserved. 2 * Copyright (C) 2011, 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 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
57 initialize(); 57 initialize();
58 } 58 }
59 59
60 MediaElementAudioSourceNode::~MediaElementAudioSourceNode() 60 MediaElementAudioSourceNode::~MediaElementAudioSourceNode()
61 { 61 {
62 ASSERT(!isInitialized()); 62 ASSERT(!isInitialized());
63 } 63 }
64 64
65 void MediaElementAudioSourceNode::dispose() 65 void MediaElementAudioSourceNode::dispose()
66 { 66 {
67 m_mediaElement->setAudioSourceNode(0); 67 m_mediaElement->setAudioSourceNode(nullptr);
68 uninitialize(); 68 uninitialize();
69 AudioSourceNode::dispose(); 69 AudioSourceNode::dispose();
70 } 70 }
71 71
72 void MediaElementAudioSourceNode::setFormat(size_t numberOfChannels, float sourc eSampleRate) 72 void MediaElementAudioSourceNode::setFormat(size_t numberOfChannels, float sourc eSampleRate)
73 { 73 {
74 if (numberOfChannels != m_sourceNumberOfChannels || sourceSampleRate != m_so urceSampleRate) { 74 if (numberOfChannels != m_sourceNumberOfChannels || sourceSampleRate != m_so urceSampleRate) {
75 if (!numberOfChannels || numberOfChannels > AudioContext::maxNumberOfCha nnels() || !AudioUtilities::isValidAudioBufferSampleRate(sourceSampleRate)) { 75 if (!numberOfChannels || numberOfChannels > AudioContext::maxNumberOfCha nnels() || !AudioUtilities::isValidAudioBufferSampleRate(sourceSampleRate)) {
76 // process() will generate silence for these uninitialized values. 76 // process() will generate silence for these uninitialized values.
77 WTF_LOG(Media, "MediaElementAudioSourceNode::setFormat(%u, %f) - unh andled format change", static_cast<unsigned>(numberOfChannels), sourceSampleRate ); 77 WTF_LOG(Media, "MediaElementAudioSourceNode::setFormat(%u, %f) - unh andled format change", static_cast<unsigned>(numberOfChannels), sourceSampleRate );
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
158 DEFINE_TRACE(MediaElementAudioSourceNode) 158 DEFINE_TRACE(MediaElementAudioSourceNode)
159 { 159 {
160 visitor->trace(m_mediaElement); 160 visitor->trace(m_mediaElement);
161 AudioSourceNode::trace(visitor); 161 AudioSourceNode::trace(visitor);
162 AudioSourceProviderClient::trace(visitor); 162 AudioSourceProviderClient::trace(visitor);
163 } 163 }
164 164
165 } // namespace blink 165 } // namespace blink
166 166
167 #endif // ENABLE(WEB_AUDIO) 167 #endif // ENABLE(WEB_AUDIO)
OLDNEW
« no previous file with comments | « Source/modules/webaudio/ChannelSplitterNode.cpp ('k') | Source/modules/webaudio/OfflineAudioContext.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698