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

Unified Diff: third_party/WebKit/Source/modules/webaudio/PeriodicWave.cpp

Issue 1670463002: [Oilpan] Unify memory usage reporters of Oilpan (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/modules/webaudio/PeriodicWave.cpp
diff --git a/third_party/WebKit/Source/modules/webaudio/PeriodicWave.cpp b/third_party/WebKit/Source/modules/webaudio/PeriodicWave.cpp
index db4c8b2cc9a016be3fa4e516175edb83966d166c..bc915f418b15bc99722a4657a6c4260522eab69d 100644
--- a/third_party/WebKit/Source/modules/webaudio/PeriodicWave.cpp
+++ b/third_party/WebKit/Source/modules/webaudio/PeriodicWave.cpp
@@ -87,8 +87,7 @@ PeriodicWave* PeriodicWave::createTriangle(float sampleRate)
}
PeriodicWave::PeriodicWave(float sampleRate)
- : m_v8ExternalMemory(0)
- , m_sampleRate(sampleRate)
+ : m_sampleRate(sampleRate)
, m_centsPerRange(CentsPerRange)
{
float nyquist = 0.5 * m_sampleRate;
@@ -101,7 +100,6 @@ PeriodicWave::PeriodicWave(float sampleRate)
PeriodicWave::~PeriodicWave()
{
- adjustV8ExternalMemory(-static_cast<int64_t>(m_v8ExternalMemory));
}
unsigned PeriodicWave::periodicWaveSize() const
@@ -168,13 +166,6 @@ unsigned PeriodicWave::numberOfPartialsForRange(unsigned rangeIndex) const
return numberOfPartials;
}
-// Tell V8 about the memory we're using so it can properly schedule garbage collects.
-void PeriodicWave::adjustV8ExternalMemory(int delta)
-{
- v8::Isolate::GetCurrent()->AdjustAmountOfExternalAllocatedMemory(delta);
- m_v8ExternalMemory += delta;
-}
-
// Convert into time-domain wave buffers.
// One table is created for each range for non-aliasing playback at different playback rates.
// Thus, higher ranges have more high-frequency partials culled out.
@@ -223,7 +214,6 @@ void PeriodicWave::createBandLimitedTables(const float* realData, const float* i
// Create the band-limited table.
unsigned waveSize = periodicWaveSize();
OwnPtr<AudioFloatArray> table = adoptPtr(new AudioFloatArray(waveSize));
- adjustV8ExternalMemory(waveSize * sizeof(float));
m_bandLimitedTables.append(table.release());
// Apply an inverse FFT to generate the time-domain table data.
@@ -328,4 +318,3 @@ void PeriodicWave::generateBasicWaveform(int shape)
}
} // namespace blink
-

Powered by Google App Engine
This is Rietveld 408576698