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 "core/dom/ActiveDOMObject.h" | |
10 #include "modules/ModulesExport.h" | 11 #include "modules/ModulesExport.h" |
11 #include "platform/heap/Handle.h" | 12 #include "platform/heap/Handle.h" |
12 #include "public/platform/modules/mediasession/WebMediaSession.h" | 13 #include "public/platform/modules/mediasession/WebMediaSession.h" |
13 #include "wtf/OwnPtr.h" | 14 #include "wtf/OwnPtr.h" |
14 | 15 |
15 namespace blink { | 16 namespace blink { |
16 | 17 |
17 class ScriptState; | 18 class ScriptState; |
18 | 19 |
19 class MODULES_EXPORT MediaSession | 20 class MODULES_EXPORT MediaSession |
20 : public GarbageCollectedFinalized<MediaSession> | 21 : public GarbageCollectedFinalized<MediaSession> |
21 , public ScriptWrappable { | 22 , public ScriptWrappable |
23 , public ActiveDOMObject { | |
mlamouri (slow - plz ping)
2015/12/07 18:14:53
If you make MediaSession an ActiveDOMObject, you m
davve
2015/12/08 10:21:23
Acknowledged.
| |
22 DEFINE_WRAPPERTYPEINFO(); | 24 DEFINE_WRAPPERTYPEINFO(); |
23 public: | 25 public: |
24 static MediaSession* create(ExecutionContext*, ExceptionState&); | 26 static MediaSession* create(ExecutionContext*, ExceptionState&); |
25 | 27 |
26 ScriptPromise activate(ScriptState*); | 28 ScriptPromise activate(ScriptState*); |
27 ScriptPromise deactivate(ScriptState*); | 29 ScriptPromise deactivate(ScriptState*); |
28 | 30 |
31 // ActiveDOMObject functions. | |
32 bool hasPendingActivity() const override; | |
mlamouri (slow - plz ping)
2015/12/07 18:14:53
I'm not entirely convinced with this addition. Cal
davve
2015/12/08 10:21:23
I think it's an interesting idea and it matches be
philipj_slow
2015/12/08 10:38:45
Something like this should work, but the lifetime
davve
2015/12/09 11:20:18
I punted on this issue in ps#11 by not involving t
| |
33 | |
29 DEFINE_INLINE_TRACE() { } | 34 DEFINE_INLINE_TRACE() { } |
30 | 35 |
31 private: | 36 private: |
32 friend class MediaSessionTest; | 37 friend class MediaSessionTest; |
33 | 38 |
34 explicit MediaSession(PassOwnPtr<WebMediaSession>); | 39 MediaSession(ExecutionContext*, PassOwnPtr<WebMediaSession>); |
35 | 40 |
36 OwnPtr<WebMediaSession> m_webMediaSession; | 41 OwnPtr<WebMediaSession> m_webMediaSession; |
37 }; | 42 }; |
38 | 43 |
39 } // namespace blink | 44 } // namespace blink |
40 | 45 |
41 #endif // MediaSession_h | 46 #endif // MediaSession_h |
OLD | NEW |