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

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

Issue 2031393003: WebAudio: record whether user gesture was available and provided. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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
Index: third_party/WebKit/Source/modules/webaudio/AbstractAudioContext.h
diff --git a/third_party/WebKit/Source/modules/webaudio/AbstractAudioContext.h b/third_party/WebKit/Source/modules/webaudio/AbstractAudioContext.h
index 53c158fbf02b32cbf9f524272e9b02c81b760289..6722b8b8fe24c66c766bc540ee5bef9f1a55f798 100644
--- a/third_party/WebKit/Source/modules/webaudio/AbstractAudioContext.h
+++ b/third_party/WebKit/Source/modules/webaudio/AbstractAudioContext.h
@@ -261,6 +261,12 @@ public:
// Get the PeriodicWave for the specified oscillator type. The table is initialized internally
// if necessary.
PeriodicWave* periodicWave(int type);
+
+ // Check whether the AudioContext requires a user gesture and whether the
+ // current stack is processing user gesture and record these information in
+ // a histogram.
+ void recordUserGesture();
+
protected:
explicit AbstractAudioContext(Document*);
AbstractAudioContext(Document*, unsigned numberOfChannels, size_t numberOfFrames, float sampleRate);
@@ -336,6 +342,9 @@ private:
// excessive number of times.
bool m_isResolvingResumePromises;
+ // Whether a user gesture is required to start this AudioContext.
+ bool m_userGestureRequired;
+
unsigned m_connectionCount;
// Graph locking.

Powered by Google App Engine
This is Rietveld 408576698