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&); |
17 | 25 |
18 void activate(); | 26 ScriptPromise activate(ScriptState*); |
19 void deactivate(); | 27 ScriptPromise deactivate(ScriptState*); |
20 | 28 |
21 DEFINE_INLINE_TRACE() { } | 29 DEFINE_INLINE_TRACE() { } |
22 | 30 |
23 private: | 31 private: |
24 MediaSession() = default; | 32 friend class MediaSessionTest; |
| 33 |
| 34 explicit MediaSession(PassOwnPtr<WebMediaSession>); |
| 35 |
| 36 OwnPtr<WebMediaSession> m_webMediaSession; |
25 }; | 37 }; |
26 | 38 |
27 } // namespace blink | 39 } // namespace blink |
28 | 40 |
29 #endif // MediaSession_h | 41 #endif // MediaSession_h |
OLD | NEW |