| 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/HTMLMediaElementMediaSession.h" | 5 #include "modules/mediasession/HTMLMediaElementMediaSession.h" |
| 6 | 6 |
| 7 #include "core/dom/ExceptionCode.h" | 7 #include "core/dom/ExceptionCode.h" |
| 8 | 8 |
| 9 namespace blink { | 9 namespace blink { |
| 10 | 10 |
| (...skipping 18 matching lines...) Expand all Loading... |
| 29 const char* HTMLMediaElementMediaSession::supplementName() | 29 const char* HTMLMediaElementMediaSession::supplementName() |
| 30 { | 30 { |
| 31 return "HTMLMediaElementMediaSession"; | 31 return "HTMLMediaElementMediaSession"; |
| 32 } | 32 } |
| 33 | 33 |
| 34 HTMLMediaElementMediaSession& HTMLMediaElementMediaSession::from(HTMLMediaElemen
t& element) | 34 HTMLMediaElementMediaSession& HTMLMediaElementMediaSession::from(HTMLMediaElemen
t& element) |
| 35 { | 35 { |
| 36 HTMLMediaElementMediaSession* supplement = fromIfExists(element); | 36 HTMLMediaElementMediaSession* supplement = fromIfExists(element); |
| 37 if (!supplement) { | 37 if (!supplement) { |
| 38 supplement = new HTMLMediaElementMediaSession(); | 38 supplement = new HTMLMediaElementMediaSession(); |
| 39 provideTo(element, supplementName(), adoptPtrWillBeNoop(supplement)); | 39 provideTo(element, supplementName(), (supplement)); |
| 40 } | 40 } |
| 41 return *supplement; | 41 return *supplement; |
| 42 } | 42 } |
| 43 | 43 |
| 44 HTMLMediaElementMediaSession* HTMLMediaElementMediaSession::fromIfExists(HTMLMed
iaElement& element) | 44 HTMLMediaElementMediaSession* HTMLMediaElementMediaSession::fromIfExists(HTMLMed
iaElement& element) |
| 45 { | 45 { |
| 46 return static_cast<HTMLMediaElementMediaSession*>(WillBeHeapSupplement<HTMLM
ediaElement>::from(element, supplementName())); | 46 return static_cast<HTMLMediaElementMediaSession*>(HeapSupplement<HTMLMediaEl
ement>::from(element, supplementName())); |
| 47 } | 47 } |
| 48 | 48 |
| 49 DEFINE_TRACE(HTMLMediaElementMediaSession) | 49 DEFINE_TRACE(HTMLMediaElementMediaSession) |
| 50 { | 50 { |
| 51 visitor->trace(m_session); | 51 visitor->trace(m_session); |
| 52 WillBeHeapSupplement<HTMLMediaElement>::trace(visitor); | 52 HeapSupplement<HTMLMediaElement>::trace(visitor); |
| 53 } | 53 } |
| 54 | 54 |
| 55 } // namespace blink | 55 } // namespace blink |
| OLD | NEW |