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

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: Added virtual 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/modules/webaudio/PeriodicWave.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..0fb51be5ebce1e2a85ec5df92b9a2f2e69929739 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);
+ virtual ~PeriodicWave();
+
// 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;
« no previous file with comments | « no previous file | third_party/WebKit/Source/modules/webaudio/PeriodicWave.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698