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

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

Issue 2501863003: Support for AudioContextOptions latencyHint. (Closed)
Patch Set: Updates based on reviewer comments. Created 4 years 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 028ff3e9bb670b6388e9f3fdcf543aca528f0304..0a7fbcdc7d79bbca96a2adf63bc11a36e129d6ac 100644
--- a/third_party/WebKit/Source/modules/webaudio/BaseAudioContext.h
+++ b/third_party/WebKit/Source/modules/webaudio/BaseAudioContext.h
@@ -80,6 +80,7 @@ class ScriptState;
class SecurityOrigin;
class StereoPannerNode;
class WaveShaperNode;
+class WebAudioLatencyHint;
// BaseAudioContext is the cornerstone of the web audio API and all AudioNodes
// are created from it. For thread safety between the audio thread and the main
@@ -100,7 +101,9 @@ class MODULES_EXPORT BaseAudioContext : public EventTargetWithInlineData,
enum AudioContextState { Suspended, Running, Closed };
// Create an AudioContext for rendering to the audio hardware.
- static BaseAudioContext* create(Document&, ExceptionState&);
+ static BaseAudioContext* create(Document&,
+ const WebAudioLatencyHint&,
hongchan 2016/12/02 17:40:12 BaseAudioContext neeeds |AudioContextOptions|. |Au
Andrew MacPherson 2016/12/05 14:12:53 Done.
+ ExceptionState&);
~BaseAudioContext() override;
@@ -137,7 +140,15 @@ class MODULES_EXPORT BaseAudioContext : public EventTargetWithInlineData,
}
float sampleRate() const {
- return m_destinationNode ? m_destinationNode->handler().sampleRate() : 0;
+ return m_destinationNode
+ ? m_destinationNode->audioDestinationHandler().sampleRate()
+ : 0;
+ }
+
+ float framesPerBuffer() const {
+ return m_destinationNode
+ ? m_destinationNode->audioDestinationHandler().framesPerBuffer()
+ : 0;
}
String state() const;
@@ -305,7 +316,7 @@ class MODULES_EXPORT BaseAudioContext : public EventTargetWithInlineData,
void maybeRecordStartAttempt();
protected:
- explicit BaseAudioContext(Document*);
+ explicit BaseAudioContext(Document*, const WebAudioLatencyHint&);
BaseAudioContext(Document*,
unsigned numberOfChannels,
size_t numberOfFrames,

Powered by Google App Engine
This is Rietveld 408576698