| Index: Source/core/css/MediaQueryList.cpp
|
| diff --git a/Source/core/css/MediaQueryList.cpp b/Source/core/css/MediaQueryList.cpp
|
| index fd55bd562cd84a0be5ef9fd317acd3f327b092b8..0fd6ec6bab1f1edaafe8ca4aa2506babecac060d 100644
|
| --- a/Source/core/css/MediaQueryList.cpp
|
| +++ b/Source/core/css/MediaQueryList.cpp
|
| @@ -54,7 +54,7 @@ String MediaQueryList::media() const
|
| return m_media->mediaText();
|
| }
|
|
|
| -void MediaQueryList::addListener(PassRefPtrWillBeRawPtr<MediaQueryListListener> listener)
|
| +void MediaQueryList::addListener(PassRefPtrWillBeRawPtr<Listener> listener)
|
| {
|
| if (!listener)
|
| return;
|
| @@ -63,7 +63,7 @@ void MediaQueryList::addListener(PassRefPtrWillBeRawPtr<MediaQueryListListener>
|
| m_listeners.add(listener);
|
| }
|
|
|
| -void MediaQueryList::removeListener(PassRefPtrWillBeRawPtr<MediaQueryListListener> listener)
|
| +void MediaQueryList::removeListener(PassRefPtrWillBeRawPtr<Listener> listener)
|
| {
|
| if (!listener)
|
| return;
|
| @@ -71,10 +71,10 @@ void MediaQueryList::removeListener(PassRefPtrWillBeRawPtr<MediaQueryListListene
|
| RefPtrWillBeRawPtr<MediaQueryList> protect(this);
|
| listener->clearMediaQueryList();
|
|
|
| + // We can't just use m_listeners.remove() here, because we get a new wrapper for the
|
| + // listener callback every time. We have to use MediaQueryListListener::operator==.
|
| for (ListenerList::iterator it = m_listeners.begin(), end = m_listeners.end(); it != end; ++it) {
|
| - // We can't just use m_listeners.remove() here, because we get a new wrapper for the
|
| - // listener callback every time. We have to use MediaQueryListListener::operator==.
|
| - if (**it == *listener.get()) {
|
| + if ((*it)->equals(listener.get())) {
|
| m_listeners.remove(it);
|
| break;
|
| }
|
| @@ -86,13 +86,13 @@ void MediaQueryList::documentDetached()
|
| m_listeners.clear();
|
| }
|
|
|
| -void MediaQueryList::mediaFeaturesChanged(WillBeHeapVector<RefPtrWillBeMember<MediaQueryListListener> >* toNotify)
|
| +void MediaQueryList::mediaFeaturesChanged(WillBeHeapVector<RefPtrWillBeMember<Listener> >* listenersToNotify)
|
| {
|
| m_matchesDirty = true;
|
| if (!updateMatches())
|
| return;
|
| for (ListenerList::const_iterator it = m_listeners.begin(), end = m_listeners.end(); it != end; ++it) {
|
| - toNotify->append(*it);
|
| + listenersToNotify->append(*it);
|
| }
|
| }
|
|
|
|
|