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

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

Issue 2060833002: Implementation of 'AudioContext.getOutputTimestamp' method (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebased 'global-interface-listing-expected' layout test results Created 4 years, 1 month 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.cpp
diff --git a/third_party/WebKit/Source/modules/webaudio/BaseAudioContext.cpp b/third_party/WebKit/Source/modules/webaudio/BaseAudioContext.cpp
index 020e539047db244fcc9878bc8f9e5da1fe0beefa..e70e02f261dc63f3c917cab8641dbe81bbc3af15 100644
--- a/third_party/WebKit/Source/modules/webaudio/BaseAudioContext.cpp
+++ b/third_party/WebKit/Source/modules/webaudio/BaseAudioContext.cpp
@@ -102,7 +102,8 @@ BaseAudioContext::BaseAudioContext(Document* document)
m_periodicWaveSine(nullptr),
m_periodicWaveSquare(nullptr),
m_periodicWaveSawtooth(nullptr),
- m_periodicWaveTriangle(nullptr) {
+ m_periodicWaveTriangle(nullptr),
+ m_outputPosition() {
Raymond Toy 2016/11/04 17:51:40 Don't you want to initialize this to something? I
Mikhail 2016/11/07 18:28:03 this invokes "default" constructor for the structu
// If mediaPlaybackRequiresUserGesture is enabled, cross origin iframes will
// require user gesture for the AudioContext to produce sound.
if (document->settings() &&
@@ -135,7 +136,8 @@ BaseAudioContext::BaseAudioContext(Document* document,
m_periodicWaveSine(nullptr),
m_periodicWaveSquare(nullptr),
m_periodicWaveSawtooth(nullptr),
- m_periodicWaveTriangle(nullptr) {}
+ m_periodicWaveTriangle(nullptr),
+ m_outputPosition() {}
BaseAudioContext::~BaseAudioContext() {
deferredTaskHandler().contextWillBeDestroyed();
@@ -706,7 +708,8 @@ void BaseAudioContext::handleStoppableSourceNodes() {
}
}
-void BaseAudioContext::handlePreRenderTasks() {
+void BaseAudioContext::handlePreRenderTasks(
+ const AudioIOPosition& outputPosition) {
DCHECK(isAudioThread());
// At the beginning of every render quantum, try to update the internal
@@ -724,6 +727,9 @@ void BaseAudioContext::handlePreRenderTasks() {
// Update the dirty state of the listener.
listener()->updateState();
+ // Update output timestamp.
+ m_outputPosition = outputPosition;
+
unlock();
}
}
@@ -817,6 +823,11 @@ bool BaseAudioContext::isAllowedToStart() const {
return false;
}
+AudioIOPosition BaseAudioContext::outputPosition() {
+ AutoLocker locker(this);
+ return m_outputPosition;
+}
+
void BaseAudioContext::rejectPendingResolvers() {
DCHECK(isMainThread());

Powered by Google App Engine
This is Rietveld 408576698