| 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/ScriptState.h" | |
| 8 #include "core/dom/ExecutionContext.h" | 7 #include "core/dom/ExecutionContext.h" |
| 9 #include "modules/mediasession/MediaSession.h" | 8 #include "modules/mediasession/MediaSession.h" |
| 10 #include "platform/Supplementable.h" | 9 #include "platform/Supplementable.h" |
| 10 #include "platform/bindings/ScriptState.h" |
| 11 | 11 |
| 12 namespace blink { | 12 namespace blink { |
| 13 | 13 |
| 14 NavigatorMediaSession::NavigatorMediaSession(Navigator& navigator) | 14 NavigatorMediaSession::NavigatorMediaSession(Navigator& navigator) |
| 15 : Supplement<Navigator>(navigator) {} | 15 : Supplement<Navigator>(navigator) {} |
| 16 | 16 |
| 17 DEFINE_TRACE(NavigatorMediaSession) { | 17 DEFINE_TRACE(NavigatorMediaSession) { |
| 18 visitor->Trace(session_); | 18 visitor->Trace(session_); |
| 19 Supplement<Navigator>::Trace(visitor); | 19 Supplement<Navigator>::Trace(visitor); |
| 20 } | 20 } |
| (...skipping 14 matching lines...) Expand all Loading... |
| 35 | 35 |
| 36 MediaSession* NavigatorMediaSession::mediaSession(ScriptState* script_state, | 36 MediaSession* NavigatorMediaSession::mediaSession(ScriptState* script_state, |
| 37 Navigator& navigator) { | 37 Navigator& navigator) { |
| 38 NavigatorMediaSession& self = NavigatorMediaSession::From(navigator); | 38 NavigatorMediaSession& self = NavigatorMediaSession::From(navigator); |
| 39 if (!self.session_) | 39 if (!self.session_) |
| 40 self.session_ = MediaSession::Create(ExecutionContext::From(script_state)); | 40 self.session_ = MediaSession::Create(ExecutionContext::From(script_state)); |
| 41 return self.session_.Get(); | 41 return self.session_.Get(); |
| 42 } | 42 } |
| 43 | 43 |
| 44 } // namespace blink | 44 } // namespace blink |
| OLD | NEW |