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/ScriptPromise.h" |
9 #include "bindings/core/v8/ScriptWrappable.h" | 9 #include "bindings/core/v8/ScriptWrappable.h" |
10 #include "modules/ModulesExport.h" | 10 #include "modules/ModulesExport.h" |
11 #include "platform/heap/Handle.h" | 11 #include "platform/heap/Handle.h" |
12 #include "public/platform/modules/mediasession/WebMediaSession.h" | 12 #include "public/platform/modules/mediasession/WebMediaSession.h" |
13 #include "wtf/OwnPtr.h" | 13 #include "wtf/OwnPtr.h" |
14 | 14 |
15 namespace blink { | 15 namespace blink { |
16 | 16 |
17 class MediaMetadata; | 17 class MediaMetadata; |
18 class ScriptState; | 18 class ScriptState; |
19 | 19 |
20 class MODULES_EXPORT MediaSession final | 20 class MODULES_EXPORT MediaSession final |
21 : public GarbageCollectedFinalized<MediaSession> | 21 : public GarbageCollectedFinalized<MediaSession> |
22 , public ScriptWrappable { | 22 , public ScriptWrappable { |
23 DEFINE_WRAPPERTYPEINFO(); | 23 DEFINE_WRAPPERTYPEINFO(); |
24 public: | 24 public: |
25 static MediaSession* create(ExecutionContext*, ExceptionState&); | 25 static MediaSession* create(ExecutionContext*, ExceptionState&); |
26 | 26 |
27 WebMediaSession* webMediaSession() { return m_webMediaSession.get(); } | 27 WebMediaSession* getWebMediaSession() { return m_webMediaSession.get(); } |
28 | 28 |
29 ScriptPromise activate(ScriptState*); | 29 ScriptPromise activate(ScriptState*); |
30 ScriptPromise deactivate(ScriptState*); | 30 ScriptPromise deactivate(ScriptState*); |
31 | 31 |
32 void setMetadata(MediaMetadata*); | 32 void setMetadata(MediaMetadata*); |
33 MediaMetadata* metadata() const; | 33 MediaMetadata* metadata() const; |
34 | 34 |
35 DECLARE_VIRTUAL_TRACE(); | 35 DECLARE_VIRTUAL_TRACE(); |
36 | 36 |
37 private: | 37 private: |
38 friend class MediaSessionTest; | 38 friend class MediaSessionTest; |
39 | 39 |
40 explicit MediaSession(PassOwnPtr<WebMediaSession>); | 40 explicit MediaSession(PassOwnPtr<WebMediaSession>); |
41 | 41 |
42 OwnPtr<WebMediaSession> m_webMediaSession; | 42 OwnPtr<WebMediaSession> m_webMediaSession; |
43 Member<MediaMetadata> m_metadata; | 43 Member<MediaMetadata> m_metadata; |
44 }; | 44 }; |
45 | 45 |
46 } // namespace blink | 46 } // namespace blink |
47 | 47 |
48 #endif // MediaSession_h | 48 #endif // MediaSession_h |
OLD | NEW |