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 #include "modules/remoteplayback/RemotePlayback.h" | 5 #include "modules/remoteplayback/RemotePlayback.h" |
6 | 6 |
7 #include "bindings/core/v8/ScriptPromiseResolver.h" | 7 #include "bindings/core/v8/ScriptPromiseResolver.h" |
8 #include "bindings/modules/v8/RemotePlaybackAvailabilityCallback.h" | 8 #include "bindings/modules/v8/RemotePlaybackAvailabilityCallback.h" |
9 #include "core/HTMLNames.h" | 9 #include "core/HTMLNames.h" |
10 #include "core/dom/DOMException.h" | 10 #include "core/dom/DOMException.h" |
(...skipping 28 matching lines...) Expand all Loading... |
39 } | 39 } |
40 | 40 |
41 } // anonymous namespace | 41 } // anonymous namespace |
42 | 42 |
43 // static | 43 // static |
44 RemotePlayback* RemotePlayback::create(HTMLMediaElement& element) { | 44 RemotePlayback* RemotePlayback::create(HTMLMediaElement& element) { |
45 return new RemotePlayback(element); | 45 return new RemotePlayback(element); |
46 } | 46 } |
47 | 47 |
48 RemotePlayback::RemotePlayback(HTMLMediaElement& element) | 48 RemotePlayback::RemotePlayback(HTMLMediaElement& element) |
49 : ActiveScriptWrappable(this), | 49 : m_state(element.isPlayingRemotely() |
50 m_state(element.isPlayingRemotely() | |
51 ? WebRemotePlaybackState::Connected | 50 ? WebRemotePlaybackState::Connected |
52 : WebRemotePlaybackState::Disconnected), | 51 : WebRemotePlaybackState::Disconnected), |
53 m_availability(WebRemotePlaybackAvailability::Unknown), | 52 m_availability(WebRemotePlaybackAvailability::Unknown), |
54 m_mediaElement(&element) {} | 53 m_mediaElement(&element) {} |
55 | 54 |
56 const AtomicString& RemotePlayback::interfaceName() const { | 55 const AtomicString& RemotePlayback::interfaceName() const { |
57 return EventTargetNames::RemotePlayback; | 56 return EventTargetNames::RemotePlayback; |
58 } | 57 } |
59 | 58 |
60 ExecutionContext* RemotePlayback::getExecutionContext() const { | 59 ExecutionContext* RemotePlayback::getExecutionContext() const { |
(...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
307 } | 306 } |
308 | 307 |
309 DEFINE_TRACE_WRAPPERS(RemotePlayback) { | 308 DEFINE_TRACE_WRAPPERS(RemotePlayback) { |
310 for (auto callback : m_availabilityCallbacks.values()) { | 309 for (auto callback : m_availabilityCallbacks.values()) { |
311 visitor->traceWrappers(callback); | 310 visitor->traceWrappers(callback); |
312 } | 311 } |
313 EventTargetWithInlineData::traceWrappers(visitor); | 312 EventTargetWithInlineData::traceWrappers(visitor); |
314 } | 313 } |
315 | 314 |
316 } // namespace blink | 315 } // namespace blink |
OLD | NEW |