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

Unified Diff: Source/modules/webaudio/RealtimeAnalyser.cpp

Issue 363613003: Removing using declarations that import names in the C++ Standard library. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/modules/webaudio/PannerNode.cpp ('k') | Source/modules/webaudio/WaveShaperDSPKernel.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/modules/webaudio/RealtimeAnalyser.cpp
diff --git a/Source/modules/webaudio/RealtimeAnalyser.cpp b/Source/modules/webaudio/RealtimeAnalyser.cpp
index b768a243917d2957332c1c4ceb27572a82094ef8..e5aae59ab10af339b67d8467491e6d3c7e53b636 100644
--- a/Source/modules/webaudio/RealtimeAnalyser.cpp
+++ b/Source/modules/webaudio/RealtimeAnalyser.cpp
@@ -40,8 +40,6 @@
#include "wtf/MathExtras.h"
#include "wtf/Uint8Array.h"
-using namespace std;
-
namespace WebCore {
const double RealtimeAnalyser::DefaultSmoothingTimeConstant = 0.8;
@@ -181,8 +179,8 @@ void RealtimeAnalyser::doFFTAnalysis()
// A value of 0 does no averaging with the previous result. Larger values produce slower, but smoother changes.
double k = m_smoothingTimeConstant;
- k = max(0.0, k);
- k = min(1.0, k);
+ k = std::max(0.0, k);
+ k = std::min(1.0, k);
// Convert the analysis data from complex to magnitude and average with the previous result.
float* destination = magnitudeBuffer().data();
@@ -206,7 +204,7 @@ void RealtimeAnalyser::getFloatFrequencyData(Float32Array* destinationArray)
// Convert from linear magnitude to floating-point decibels.
const double minDecibels = m_minDecibels;
unsigned sourceLength = magnitudeBuffer().size();
- size_t len = min(sourceLength, destinationArray->length());
+ size_t len = std::min(sourceLength, destinationArray->length());
if (len > 0) {
const float* source = magnitudeBuffer().data();
float* destination = destinationArray->data();
@@ -230,7 +228,7 @@ void RealtimeAnalyser::getByteFrequencyData(Uint8Array* destinationArray)
// Convert from linear magnitude to unsigned-byte decibels.
unsigned sourceLength = magnitudeBuffer().size();
- size_t len = min(sourceLength, destinationArray->length());
+ size_t len = std::min(sourceLength, destinationArray->length());
if (len > 0) {
const double rangeScaleFactor = m_maxDecibels == m_minDecibels ? 1 : 1 / (m_maxDecibels - m_minDecibels);
const double minDecibels = m_minDecibels;
@@ -264,7 +262,7 @@ void RealtimeAnalyser::getFloatTimeDomainData(Float32Array* destinationArray)
return;
unsigned fftSize = this->fftSize();
- size_t len = min(fftSize, destinationArray->length());
+ size_t len = std::min(fftSize, destinationArray->length());
if (len > 0) {
bool isInputBufferGood = m_inputBuffer.size() == InputBufferSize && m_inputBuffer.size() > fftSize;
ASSERT(isInputBufferGood);
@@ -293,7 +291,7 @@ void RealtimeAnalyser::getByteTimeDomainData(Uint8Array* destinationArray)
return;
unsigned fftSize = this->fftSize();
- size_t len = min(fftSize, destinationArray->length());
+ size_t len = std::min(fftSize, destinationArray->length());
if (len > 0) {
bool isInputBufferGood = m_inputBuffer.size() == InputBufferSize && m_inputBuffer.size() > fftSize;
ASSERT(isInputBufferGood);
« no previous file with comments | « Source/modules/webaudio/PannerNode.cpp ('k') | Source/modules/webaudio/WaveShaperDSPKernel.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698