OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef MediaSession_h | 5 #ifndef MediaSession_h |
6 #define MediaSession_h | 6 #define MediaSession_h |
7 | 7 |
| 8 #include "bindings/core/v8/ScriptPromise.h" |
8 #include "bindings/core/v8/ScriptWrappable.h" | 9 #include "bindings/core/v8/ScriptWrappable.h" |
| 10 #include "modules/ModulesExport.h" |
9 #include "platform/heap/Handle.h" | 11 #include "platform/heap/Handle.h" |
| 12 #include "public/platform/modules/mediasession/WebMediaSession.h" |
| 13 #include "wtf/OwnPtr.h" |
10 | 14 |
11 namespace blink { | 15 namespace blink { |
12 | 16 |
13 class MediaSession : public GarbageCollected<MediaSession>, public ScriptWrappab
le { | 17 class ScriptState; |
| 18 |
| 19 class MODULES_EXPORT MediaSession |
| 20 : public GarbageCollectedFinalized<MediaSession> |
| 21 , public ScriptWrappable { |
14 DEFINE_WRAPPERTYPEINFO(); | 22 DEFINE_WRAPPERTYPEINFO(); |
15 public: | 23 public: |
16 static MediaSession* create(); | 24 static MediaSession* create(ExecutionContext*, ExceptionState&); |
| 25 static MediaSession* createForTesting(PassOwnPtr<WebMediaSession>); |
17 | 26 |
18 void activate(); | 27 ScriptPromise activate(ScriptState*); |
19 void deactivate(); | 28 ScriptPromise deactivate(ScriptState*); |
20 | 29 |
21 DEFINE_INLINE_TRACE() { } | 30 DEFINE_INLINE_TRACE() { } |
22 | 31 |
23 private: | 32 private: |
24 MediaSession() = default; | 33 explicit MediaSession(PassOwnPtr<WebMediaSession>); |
| 34 |
| 35 OwnPtr<WebMediaSession> m_webMediaSession; |
25 }; | 36 }; |
26 | 37 |
27 } // namespace blink | 38 } // namespace blink |
28 | 39 |
29 #endif // MediaSession_h | 40 #endif // MediaSession_h |
OLD | NEW |