OLD | NEW |
---|---|
(Empty) | |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef OnlineAudioContext_h | |
6 #define OnlineAudioContext_h | |
7 | |
8 #include "bindings/core/v8/ScriptPromise.h" | |
9 #include "bindings/core/v8/ScriptPromiseResolver.h" | |
10 #include "modules/webaudio/AudioContext.h" | |
11 #include "platform/heap/Handle.h" | |
12 | |
13 namespace blink { | |
14 | |
15 class Document; | |
16 class ExceptionState; | |
17 class ScriptState; | |
18 | |
19 // This is an AudioContext which actually plays sound, unlike an | |
20 // OfflineAudioContext which renders sound into a buffer. | |
21 class OnlineAudioContext : public AudioContext { | |
Raymond Toy
2015/06/27 15:38:11
Would it be possible in this CL to rename AudioCon
| |
22 public: | |
23 static AudioContext* create(Document&, ExceptionState&); | |
24 | |
25 virtual ~OnlineAudioContext(); | |
26 DECLARE_VIRTUAL_TRACE(); | |
27 | |
28 virtual ScriptPromise closeContext(ScriptState*) override final; | |
29 virtual bool isContextClosed() const override final; | |
30 | |
31 virtual ScriptPromise suspendContext(ScriptState*) override final; | |
32 virtual ScriptPromise resumeContext(ScriptState*) override final; | |
33 | |
34 virtual bool hasRealtimeConstraint() override final { return true; } | |
35 | |
36 protected: | |
37 OnlineAudioContext(Document&); | |
38 | |
39 virtual void didClose() override final; | |
40 | |
41 private: | |
42 void stopRendering(); | |
43 | |
44 unsigned m_contextId; | |
45 RefPtrWillBeMember<ScriptPromiseResolver> m_closeResolver; | |
46 }; | |
47 | |
48 } | |
49 | |
50 #endif // OnlineAudioContext_h | |
OLD | NEW |