Index: third_party/WebKit/Source/core/css/MediaQueryList.cpp |
diff --git a/third_party/WebKit/Source/core/css/MediaQueryList.cpp b/third_party/WebKit/Source/core/css/MediaQueryList.cpp |
index 74e0b779b4b71f6f5cf73a1c490a95b479426096..525a5a6fa2ef56b69d939ff4b01816ad8f5c7fe4 100644 |
--- a/third_party/WebKit/Source/core/css/MediaQueryList.cpp |
+++ b/third_party/WebKit/Source/core/css/MediaQueryList.cpp |
@@ -29,11 +29,13 @@ |
PassRefPtrWillBeRawPtr<MediaQueryList> MediaQueryList::create(ExecutionContext* context, PassRefPtrWillBeRawPtr<MediaQueryMatcher> matcher, PassRefPtrWillBeRawPtr<MediaQuerySet> media) |
{ |
- return adoptRefWillBeNoop(new MediaQueryList(context, matcher, media)); |
+ RefPtrWillBeRawPtr<MediaQueryList> list = adoptRefWillBeNoop(new MediaQueryList(context, matcher, media)); |
+ list->suspendIfNeeded(); |
+ return list.release(); |
} |
MediaQueryList::MediaQueryList(ExecutionContext* context, PassRefPtrWillBeRawPtr<MediaQueryMatcher> matcher, PassRefPtrWillBeRawPtr<MediaQuerySet> media) |
- : ContextLifecycleObserver(context) |
+ : ActiveDOMObject(context) |
, m_matcher(matcher) |
, m_media(media) |
, m_matchesDirty(true) |
@@ -93,7 +95,7 @@ |
return m_listeners.size() || hasEventListeners(EventTypeNames::change); |
} |
-void MediaQueryList::contextDestroyed() |
+void MediaQueryList::stop() |
{ |
// m_listeners.clear() can drop the last ref to this MediaQueryList. |
RefPtrWillBeRawPtr<MediaQueryList> protect(this); |
@@ -136,7 +138,7 @@ |
visitor->trace(m_listeners); |
#endif |
EventTargetWithInlineData::trace(visitor); |
- ContextLifecycleObserver::trace(visitor); |
+ ActiveDOMObject::trace(visitor); |
} |
const AtomicString& MediaQueryList::interfaceName() const |
@@ -146,7 +148,7 @@ |
ExecutionContext* MediaQueryList::executionContext() const |
{ |
- return ContextLifecycleObserver::executionContext(); |
+ return ActiveDOMObject::executionContext(); |
} |
} // namespace blink |