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

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

Issue 2314903002: Web Audio: when media playback requires a user gesture, apply rule to cross origin iframes. (Closed)
Patch Set: move click simulation to top frame Created 4 years, 3 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/BaseAudioContext.h
diff --git a/third_party/WebKit/Source/modules/webaudio/BaseAudioContext.h b/third_party/WebKit/Source/modules/webaudio/BaseAudioContext.h
index aea84aa2697dd34f91c933bb361d052006f7fdb3..d5867dddbafc919eb571879aefda7201ed64be3d 100644
--- a/third_party/WebKit/Source/modules/webaudio/BaseAudioContext.h
+++ b/third_party/WebKit/Source/modules/webaudio/BaseAudioContext.h
@@ -244,7 +244,9 @@ public:
DEFINE_ATTRIBUTE_EVENT_LISTENER(statechange);
+ // Start the AudioContext. `isAllowedToStart()` MUST be called before.
void startRendering();
+
void notifyStateChange();
// A context is considered closed if:
@@ -259,11 +261,6 @@ public:
// 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 recordUserGestureState();
-
protected:
explicit BaseAudioContext(Document*);
BaseAudioContext(Document*, unsigned numberOfChannels, size_t numberOfFrames, float sampleRate);
@@ -293,6 +290,13 @@ protected:
void rejectPendingDecodeAudioDataResolvers();
+ // If any, unlock user gesture requirements if a user gesture is being
+ // processed.
+ void maybeUnlockUserGesture();
+
+ // Returns whether the AudioContext is allowed to start rendering.
+ bool isAllowedToStart() const;
+
private:
bool m_isCleared;
void clear();

Powered by Google App Engine
This is Rietveld 408576698