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

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

Issue 1632753002: Report PeriodicWave memory usage to v8 so GC can be properly scheduled (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 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.h
diff --git a/third_party/WebKit/Source/modules/webaudio/PeriodicWave.h b/third_party/WebKit/Source/modules/webaudio/PeriodicWave.h
index 2d764fa5b55c055c47730ec5ec115e15c367f02a..a4b162e747721fc4749ce8aafb39d33516bb3900 100644
--- a/third_party/WebKit/Source/modules/webaudio/PeriodicWave.h
+++ b/third_party/WebKit/Source/modules/webaudio/PeriodicWave.h
@@ -48,6 +48,8 @@ public:
// Creates an arbitrary periodic wave given the frequency components (Fourier coefficients).
static PeriodicWave* create(float sampleRate, DOMFloat32Array* real, DOMFloat32Array* imag, bool normalize);
+ ~PeriodicWave();
jochen (gone - plz use gerrit) 2016/01/26 15:33:55 needs to be virtual
Daniel Bratell 2016/01/26 16:19:13 Done.
+
// Returns pointers to the lower and higher wave data for the pitch range containing
// the given fundamental frequency. These two tables are in adjacent "pitch" ranges
// where the higher table will have the maximum number of partials which won't alias when played back
@@ -72,6 +74,8 @@ private:
void generateBasicWaveform(int);
+ size_t m_v8ExternalMemory;
+
float m_sampleRate;
unsigned m_numberOfRanges;
float m_centsPerRange;
@@ -88,6 +92,8 @@ private:
unsigned numberOfPartialsForRange(unsigned rangeIndex) const;
+ void adjustV8ExternalMemory(int delta);
+
// Creates tables based on numberOfComponents Fourier coefficients.
void createBandLimitedTables(const float* real, const float* imag, unsigned numberOfComponents, bool disableNormalization);
Vector<OwnPtr<AudioFloatArray>> m_bandLimitedTables;

Powered by Google App Engine
This is Rietveld 408576698