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 25 matching lines...) Expand all Loading... |
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(), 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*>(HeapSupplement<HTMLMediaEl
ement>::from(element, supplementName())); | 46 return static_cast<HTMLMediaElementMediaSession*>(Supplement<HTMLMediaElemen
t>::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 HeapSupplement<HTMLMediaElement>::trace(visitor); | 52 Supplement<HTMLMediaElement>::trace(visitor); |
53 } | 53 } |
54 | 54 |
55 } // namespace blink | 55 } // namespace blink |
OLD | NEW |