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 #include "modules/mediasession/MediaSession.h" | 5 #include "modules/mediasession/MediaSession.h" |
6 | 6 |
7 #include "core/dom/Document.h" | 7 #include "core/dom/Document.h" |
8 #include "core/dom/DocumentUserGestureToken.h" | 8 #include "core/dom/DocumentUserGestureToken.h" |
9 #include "core/dom/ExecutionContext.h" | 9 #include "core/dom/ExecutionContext.h" |
10 #include "core/events/Event.h" | 10 #include "core/events/Event.h" |
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
157 DCHECK(getExecutionContext()->isDocument()) | 157 DCHECK(getExecutionContext()->isDocument()) |
158 << "MediaSession::getService() is only available from a frame"; | 158 << "MediaSession::getService() is only available from a frame"; |
159 Document* document = toDocument(getExecutionContext()); | 159 Document* document = toDocument(getExecutionContext()); |
160 if (!document->frame()) | 160 if (!document->frame()) |
161 return nullptr; | 161 return nullptr; |
162 | 162 |
163 InterfaceProvider* interfaceProvider = document->frame()->interfaceProvider(); | 163 InterfaceProvider* interfaceProvider = document->frame()->interfaceProvider(); |
164 if (!interfaceProvider) | 164 if (!interfaceProvider) |
165 return nullptr; | 165 return nullptr; |
166 | 166 |
167 interfaceProvider->getInterface(mojo::GetProxy(&m_service)); | 167 interfaceProvider->getInterface(mojo::MakeRequest(&m_service)); |
168 if (m_service.get()) | 168 if (m_service.get()) |
169 m_service->SetClient(m_clientBinding.CreateInterfacePtrAndBind()); | 169 m_service->SetClient(m_clientBinding.CreateInterfacePtrAndBind()); |
170 | 170 |
171 return m_service.get(); | 171 return m_service.get(); |
172 } | 172 } |
173 | 173 |
174 bool MediaSession::addEventListenerInternal( | 174 bool MediaSession::addEventListenerInternal( |
175 const AtomicString& eventType, | 175 const AtomicString& eventType, |
176 EventListener* listener, | 176 EventListener* listener, |
177 const AddEventListenerOptionsResolved& options) { | 177 const AddEventListenerOptionsResolved& options) { |
(...skipping 26 matching lines...) Expand all Loading... |
204 dispatchEvent(Event::create(mojomActionToEventName(action))); | 204 dispatchEvent(Event::create(mojomActionToEventName(action))); |
205 } | 205 } |
206 | 206 |
207 DEFINE_TRACE(MediaSession) { | 207 DEFINE_TRACE(MediaSession) { |
208 visitor->trace(m_metadata); | 208 visitor->trace(m_metadata); |
209 EventTargetWithInlineData::trace(visitor); | 209 EventTargetWithInlineData::trace(visitor); |
210 ContextLifecycleObserver::trace(visitor); | 210 ContextLifecycleObserver::trace(visitor); |
211 } | 211 } |
212 | 212 |
213 } // namespace blink | 213 } // namespace blink |
OLD | NEW |