Chromium Code Reviews| Index: Source/modules/webaudio/OnlineAudioContext.h |
| diff --git a/Source/modules/webaudio/OnlineAudioContext.h b/Source/modules/webaudio/OnlineAudioContext.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..e5b5a641c2d8b13a77a05300964898f5f99cf448 |
| --- /dev/null |
| +++ b/Source/modules/webaudio/OnlineAudioContext.h |
| @@ -0,0 +1,50 @@ |
| +// Copyright 2015 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef OnlineAudioContext_h |
| +#define OnlineAudioContext_h |
| + |
| +#include "bindings/core/v8/ScriptPromise.h" |
| +#include "bindings/core/v8/ScriptPromiseResolver.h" |
| +#include "modules/webaudio/AudioContext.h" |
| +#include "platform/heap/Handle.h" |
| + |
| +namespace blink { |
| + |
| +class Document; |
| +class ExceptionState; |
| +class ScriptState; |
| + |
| +// This is an AudioContext which actually plays sound, unlike an |
| +// OfflineAudioContext which renders sound into a buffer. |
| +class OnlineAudioContext : public AudioContext { |
|
Raymond Toy
2015/06/27 15:38:11
Would it be possible in this CL to rename AudioCon
|
| +public: |
| + static AudioContext* create(Document&, ExceptionState&); |
| + |
| + virtual ~OnlineAudioContext(); |
| + DECLARE_VIRTUAL_TRACE(); |
| + |
| + virtual ScriptPromise closeContext(ScriptState*) override final; |
| + virtual bool isContextClosed() const override final; |
| + |
| + virtual ScriptPromise suspendContext(ScriptState*) override final; |
| + virtual ScriptPromise resumeContext(ScriptState*) override final; |
| + |
| + virtual bool hasRealtimeConstraint() override final { return true; } |
| + |
| +protected: |
| + OnlineAudioContext(Document&); |
| + |
| + virtual void didClose() override final; |
| + |
| +private: |
| + void stopRendering(); |
| + |
| + unsigned m_contextId; |
| + RefPtrWillBeMember<ScriptPromiseResolver> m_closeResolver; |
| +}; |
| + |
| +} |
| + |
| +#endif // OnlineAudioContext_h |