| 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 275 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 286 InvalidStateError, "disableRemotePlayback attribute is present.")); | 286 InvalidStateError, "disableRemotePlayback attribute is present.")); |
| 287 m_promptPromiseResolver = nullptr; | 287 m_promptPromiseResolver = nullptr; |
| 288 } | 288 } |
| 289 | 289 |
| 290 m_availabilityCallbacks.clear(); | 290 m_availabilityCallbacks.clear(); |
| 291 | 291 |
| 292 if (m_state != WebRemotePlaybackState::Disconnected) | 292 if (m_state != WebRemotePlaybackState::Disconnected) |
| 293 m_mediaElement->requestRemotePlaybackStop(); | 293 m_mediaElement->requestRemotePlaybackStop(); |
| 294 } | 294 } |
| 295 | 295 |
| 296 void RemotePlayback::setV8ReferencesForCallbacks( | |
| 297 v8::Isolate* isolate, | |
| 298 const v8::Persistent<v8::Object>& wrapper) { | |
| 299 for (auto callback : m_availabilityCallbacks.values()) | |
| 300 callback->setWrapperReference(isolate, wrapper); | |
| 301 } | |
| 302 | |
| 303 DEFINE_TRACE(RemotePlayback) { | 296 DEFINE_TRACE(RemotePlayback) { |
| 304 visitor->trace(m_availabilityCallbacks); | 297 visitor->trace(m_availabilityCallbacks); |
| 305 visitor->trace(m_promptPromiseResolver); | 298 visitor->trace(m_promptPromiseResolver); |
| 306 visitor->trace(m_mediaElement); | 299 visitor->trace(m_mediaElement); |
| 307 EventTargetWithInlineData::trace(visitor); | 300 EventTargetWithInlineData::trace(visitor); |
| 308 } | 301 } |
| 309 | 302 |
| 310 DEFINE_TRACE_WRAPPERS(RemotePlayback) { | 303 DEFINE_TRACE_WRAPPERS(RemotePlayback) { |
| 311 for (auto callback : m_availabilityCallbacks.values()) { | 304 for (auto callback : m_availabilityCallbacks.values()) { |
| 312 visitor->traceWrappers(callback); | 305 visitor->traceWrappers(callback); |
| 313 } | 306 } |
| 314 EventTargetWithInlineData::traceWrappers(visitor); | 307 EventTargetWithInlineData::traceWrappers(visitor); |
| 315 } | 308 } |
| 316 | 309 |
| 317 } // namespace blink | 310 } // namespace blink |
| OLD | NEW |