| 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/mediasession/NavigatorMediaSession.h" | 5 #include "modules/mediasession/NavigatorMediaSession.h" |
| 6 | 6 |
| 7 #include "bindings/core/v8/ExceptionStatePlaceholder.h" | 7 #include "bindings/core/v8/ScriptState.h" |
| 8 #include "modules/mediasession/MediaSession.h" | 8 #include "modules/mediasession/MediaSession.h" |
| 9 #include "platform/Supplementable.h" | 9 #include "platform/Supplementable.h" |
| 10 | 10 |
| 11 namespace blink { | 11 namespace blink { |
| 12 | 12 |
| 13 NavigatorMediaSession::NavigatorMediaSession(Navigator&) {} | 13 NavigatorMediaSession::NavigatorMediaSession(Navigator&) {} |
| 14 | 14 |
| 15 DEFINE_TRACE(NavigatorMediaSession) { | 15 DEFINE_TRACE(NavigatorMediaSession) { |
| 16 visitor->trace(m_session); | 16 visitor->trace(m_session); |
| 17 Supplement<Navigator>::trace(visitor); | 17 Supplement<Navigator>::trace(visitor); |
| (...skipping 15 matching lines...) Expand all Loading... |
| 33 | 33 |
| 34 MediaSession* NavigatorMediaSession::mediaSession(ScriptState* scriptState, | 34 MediaSession* NavigatorMediaSession::mediaSession(ScriptState* scriptState, |
| 35 Navigator& navigator) { | 35 Navigator& navigator) { |
| 36 NavigatorMediaSession& self = NavigatorMediaSession::from(navigator); | 36 NavigatorMediaSession& self = NavigatorMediaSession::from(navigator); |
| 37 if (!self.m_session) | 37 if (!self.m_session) |
| 38 self.m_session = MediaSession::create(scriptState->getExecutionContext()); | 38 self.m_session = MediaSession::create(scriptState->getExecutionContext()); |
| 39 return self.m_session.get(); | 39 return self.m_session.get(); |
| 40 } | 40 } |
| 41 | 41 |
| 42 } // namespace blink | 42 } // namespace blink |
| OLD | NEW |