| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2007, 2008, 2010 Apple Inc. All rights reserved. | 2 * Copyright (C) 2007, 2008, 2010 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 24 matching lines...) Expand all Loading... |
| 35 #include "core/html/HTMLMediaElement.h" | 35 #include "core/html/HTMLMediaElement.h" |
| 36 #include "core/html/HTMLPictureElement.h" | 36 #include "core/html/HTMLPictureElement.h" |
| 37 #include "platform/Logging.h" | 37 #include "platform/Logging.h" |
| 38 | 38 |
| 39 namespace blink { | 39 namespace blink { |
| 40 | 40 |
| 41 using namespace HTMLNames; | 41 using namespace HTMLNames; |
| 42 | 42 |
| 43 static SourceEventSender& sourceErrorEventSender() | 43 static SourceEventSender& sourceErrorEventSender() |
| 44 { | 44 { |
| 45 DEFINE_STATIC_LOCAL(SourceEventSender, sharedErrorEventSender, (EventTypeNam
es::error)); | 45 DEFINE_STATIC_LOCAL(OwnPtrWillBePersistent<SourceEventSender>, sharedErrorEv
entSender, (SourceEventSender::create(EventTypeNames::error))); |
| 46 return sharedErrorEventSender; | 46 return *sharedErrorEventSender; |
| 47 } | 47 } |
| 48 | 48 |
| 49 class HTMLSourceElement::Listener final : public MediaQueryListListener { | 49 class HTMLSourceElement::Listener final : public MediaQueryListListener { |
| 50 public: | 50 public: |
| 51 explicit Listener(HTMLSourceElement* element) : m_element(element) { } | 51 explicit Listener(HTMLSourceElement* element) : m_element(element) { } |
| 52 void notifyMediaQueryChanged() override | 52 void notifyMediaQueryChanged() override |
| 53 { | 53 { |
| 54 if (m_element) | 54 if (m_element) |
| 55 m_element->notifyMediaQueryChanged(); | 55 m_element->notifyMediaQueryChanged(); |
| 56 } | 56 } |
| (...skipping 12 matching lines...) Expand all Loading... |
| 69 : HTMLElement(sourceTag, document) | 69 : HTMLElement(sourceTag, document) |
| 70 , m_listener(adoptRefWillBeNoop(new Listener(this))) | 70 , m_listener(adoptRefWillBeNoop(new Listener(this))) |
| 71 { | 71 { |
| 72 WTF_LOG(Media, "HTMLSourceElement::HTMLSourceElement - %p", this); | 72 WTF_LOG(Media, "HTMLSourceElement::HTMLSourceElement - %p", this); |
| 73 } | 73 } |
| 74 | 74 |
| 75 DEFINE_NODE_FACTORY(HTMLSourceElement) | 75 DEFINE_NODE_FACTORY(HTMLSourceElement) |
| 76 | 76 |
| 77 HTMLSourceElement::~HTMLSourceElement() | 77 HTMLSourceElement::~HTMLSourceElement() |
| 78 { | 78 { |
| 79 #if !ENABLE(OILPAN) |
| 79 sourceErrorEventSender().cancelEvent(this); | 80 sourceErrorEventSender().cancelEvent(this); |
| 80 #if !ENABLE(OILPAN) | |
| 81 m_listener->clearElement(); | 81 m_listener->clearElement(); |
| 82 #endif | 82 #endif |
| 83 } | 83 } |
| 84 | 84 |
| 85 void HTMLSourceElement::createMediaQueryList(const AtomicString& media) | 85 void HTMLSourceElement::createMediaQueryList(const AtomicString& media) |
| 86 { | 86 { |
| 87 if (media.isEmpty()) | 87 if (media.isEmpty()) |
| 88 return; | 88 return; |
| 89 | 89 |
| 90 if (m_mediaQueryList) | 90 if (m_mediaQueryList) |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 190 } | 190 } |
| 191 | 191 |
| 192 DEFINE_TRACE(HTMLSourceElement) | 192 DEFINE_TRACE(HTMLSourceElement) |
| 193 { | 193 { |
| 194 visitor->trace(m_mediaQueryList); | 194 visitor->trace(m_mediaQueryList); |
| 195 visitor->trace(m_listener); | 195 visitor->trace(m_listener); |
| 196 HTMLElement::trace(visitor); | 196 HTMLElement::trace(visitor); |
| 197 } | 197 } |
| 198 | 198 |
| 199 } | 199 } |
| OLD | NEW |