Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 RemotePlayback_h | 5 #ifndef RemotePlayback_h |
| 6 #define RemotePlayback_h | 6 #define RemotePlayback_h |
| 7 | 7 |
| 8 #include "bindings/core/v8/ActiveScriptWrappable.h" | |
| 8 #include "bindings/core/v8/ScriptPromise.h" | 9 #include "bindings/core/v8/ScriptPromise.h" |
| 9 #include "core/events/EventTarget.h" | 10 #include "core/events/EventTarget.h" |
| 10 #include "core/frame/DOMWindowProperty.h" | 11 #include "core/frame/LocalFrameLifecycleObserver.h" |
| 11 #include "platform/heap/Handle.h" | 12 #include "platform/heap/Handle.h" |
| 12 #include "public/platform/modules/remoteplayback/WebRemotePlaybackClient.h" | 13 #include "public/platform/modules/remoteplayback/WebRemotePlaybackClient.h" |
| 13 #include "public/platform/modules/remoteplayback/WebRemotePlaybackState.h" | 14 #include "public/platform/modules/remoteplayback/WebRemotePlaybackState.h" |
| 14 #include "wtf/text/AtomicString.h" | 15 #include "wtf/text/AtomicString.h" |
| 15 #include "wtf/text/WTFString.h" | 16 #include "wtf/text/WTFString.h" |
| 16 | 17 |
| 17 namespace blink { | 18 namespace blink { |
| 18 | 19 |
| 19 class ExecutionContext; | 20 class ExecutionContext; |
| 20 class HTMLMediaElement; | 21 class HTMLMediaElement; |
| 21 class LocalFrame; | 22 class LocalFrame; |
| 22 class RemotePlaybackAvailability; | 23 class RemotePlaybackAvailability; |
| 23 class ScriptPromiseResolver; | 24 class ScriptPromiseResolver; |
| 24 | 25 |
| 25 class RemotePlayback final | 26 class RemotePlayback final |
| 26 : public EventTargetWithInlineData | 27 : public EventTargetWithInlineData |
| 27 , public DOMWindowProperty | 28 , public ActiveScriptWrappable |
| 29 , public LocalFrameLifecycleObserver | |
|
haraken
2016/06/02 23:53:52
Would you help me understand why this needs to be
whywhat
2016/06/03 13:29:38
It was a natural switch from DOMWindowPropery to b
| |
| 28 , private WebRemotePlaybackClient { | 30 , private WebRemotePlaybackClient { |
| 29 DEFINE_WRAPPERTYPEINFO(); | 31 DEFINE_WRAPPERTYPEINFO(); |
| 30 USING_GARBAGE_COLLECTED_MIXIN(RemotePlayback); | 32 USING_GARBAGE_COLLECTED_MIXIN(RemotePlayback); |
| 31 public: | 33 public: |
| 32 static RemotePlayback* create(HTMLMediaElement&); | 34 static RemotePlayback* create(HTMLMediaElement&); |
| 33 | 35 |
| 34 // EventTarget implementation. | 36 // EventTarget implementation. |
| 35 const WTF::AtomicString& interfaceName() const override; | 37 const WTF::AtomicString& interfaceName() const override; |
| 36 ExecutionContext* getExecutionContext() const override; | 38 ExecutionContext* getExecutionContext() const override; |
| 37 | 39 |
| 38 ScriptPromise getAvailability(ScriptState*); | 40 ScriptPromise getAvailability(ScriptState*); |
| 39 ScriptPromise connect(ScriptState*); | 41 ScriptPromise connect(ScriptState*); |
| 40 | 42 |
| 41 String state() const; | 43 String state() const; |
| 42 | 44 |
| 45 // ActiveScriptWrappable implementation. | |
| 46 bool hasPendingActivity() const final; | |
| 47 | |
| 43 DEFINE_ATTRIBUTE_EVENT_LISTENER(statechange); | 48 DEFINE_ATTRIBUTE_EVENT_LISTENER(statechange); |
| 44 | 49 |
| 45 DECLARE_VIRTUAL_TRACE(); | 50 DECLARE_VIRTUAL_TRACE(); |
| 46 | 51 |
| 47 private: | 52 private: |
| 48 explicit RemotePlayback(HTMLMediaElement&); | 53 explicit RemotePlayback(HTMLMediaElement&); |
| 49 | 54 |
| 50 void stateChanged(WebRemotePlaybackState) override; | 55 void stateChanged(WebRemotePlaybackState) override; |
| 51 void availabilityChanged(bool available) override; | 56 void availabilityChanged(bool available) override; |
| 52 void connectCancelled() override; | 57 void connectCancelled() override; |
| 53 | 58 |
| 54 WebRemotePlaybackState m_state; | 59 WebRemotePlaybackState m_state; |
| 55 bool m_availability; | 60 bool m_availability; |
| 56 HeapVector<Member<RemotePlaybackAvailability>> m_availabilityObjects; | 61 HeapVector<Member<RemotePlaybackAvailability>> m_availabilityObjects; |
| 57 Member<HTMLMediaElement> m_mediaElement; | 62 Member<HTMLMediaElement> m_mediaElement; |
| 58 HeapVector<Member<ScriptPromiseResolver>> m_connectPromiseResolvers; | 63 HeapVector<Member<ScriptPromiseResolver>> m_connectPromiseResolvers; |
| 59 }; | 64 }; |
| 60 | 65 |
| 61 } // namespace blink | 66 } // namespace blink |
| 62 | 67 |
| 63 #endif // RemotePlayback_h | 68 #endif // RemotePlayback_h |
| OLD | NEW |