OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012, 2013 Apple Inc. All rights
reserved. | 2 * Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012, 2013 Apple Inc. All rights
reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
144 static void removeElementFromDocumentMap(HTMLMediaElement* element, Document* do
cument) | 144 static void removeElementFromDocumentMap(HTMLMediaElement* element, Document* do
cument) |
145 { | 145 { |
146 DocumentElementSetMap& map = documentToElementSetMap(); | 146 DocumentElementSetMap& map = documentToElementSetMap(); |
147 WeakMediaElementSet set = map.take(document); | 147 WeakMediaElementSet set = map.take(document); |
148 set.remove(element); | 148 set.remove(element); |
149 if (!set.isEmpty()) | 149 if (!set.isEmpty()) |
150 map.add(document, set); | 150 map.add(document, set); |
151 } | 151 } |
152 | 152 |
153 class TrackDisplayUpdateScope { | 153 class TrackDisplayUpdateScope { |
| 154 STACK_ALLOCATED(); |
154 public: | 155 public: |
155 TrackDisplayUpdateScope(HTMLMediaElement* mediaElement) | 156 TrackDisplayUpdateScope(HTMLMediaElement* mediaElement) |
156 { | 157 { |
157 m_mediaElement = mediaElement; | 158 m_mediaElement = mediaElement; |
158 m_mediaElement->beginIgnoringTrackDisplayUpdateRequests(); | 159 m_mediaElement->beginIgnoringTrackDisplayUpdateRequests(); |
159 } | 160 } |
160 ~TrackDisplayUpdateScope() | 161 ~TrackDisplayUpdateScope() |
161 { | 162 { |
162 ASSERT(m_mediaElement); | 163 ASSERT(m_mediaElement); |
163 m_mediaElement->endIgnoringTrackDisplayUpdateRequests(); | 164 m_mediaElement->endIgnoringTrackDisplayUpdateRequests(); |
164 } | 165 } |
165 | 166 |
166 private: | 167 private: |
167 HTMLMediaElement* m_mediaElement; | 168 RawPtrWillBeMember<HTMLMediaElement> m_mediaElement; |
168 }; | 169 }; |
169 | 170 |
170 static const AtomicString& AudioKindToString(WebMediaPlayerClient::AudioTrackKin
d kind) | 171 static const AtomicString& AudioKindToString(WebMediaPlayerClient::AudioTrackKin
d kind) |
171 { | 172 { |
172 switch (kind) { | 173 switch (kind) { |
173 case WebMediaPlayerClient::AudioTrackKindNone: | 174 case WebMediaPlayerClient::AudioTrackKindNone: |
174 return emptyAtom; | 175 return emptyAtom; |
175 case WebMediaPlayerClient::AudioTrackKindAlternative: | 176 case WebMediaPlayerClient::AudioTrackKindAlternative: |
176 return AudioTrack::alternativeKeyword(); | 177 return AudioTrack::alternativeKeyword(); |
177 case WebMediaPlayerClient::AudioTrackKindDescriptions: | 178 case WebMediaPlayerClient::AudioTrackKindDescriptions: |
(...skipping 3771 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3949 | 3950 |
3950 #if ENABLE(WEB_AUDIO) | 3951 #if ENABLE(WEB_AUDIO) |
3951 void HTMLMediaElement::clearWeakMembers(Visitor* visitor) | 3952 void HTMLMediaElement::clearWeakMembers(Visitor* visitor) |
3952 { | 3953 { |
3953 if (!visitor->isAlive(m_audioSourceNode) && audioSourceProvider()) | 3954 if (!visitor->isAlive(m_audioSourceNode) && audioSourceProvider()) |
3954 audioSourceProvider()->setClient(0); | 3955 audioSourceProvider()->setClient(0); |
3955 } | 3956 } |
3956 #endif | 3957 #endif |
3957 | 3958 |
3958 } | 3959 } |
OLD | NEW |