Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(200)

Unified Diff: third_party/WebKit/Source/core/css/MediaQueryList.cpp

Issue 1808533003: Revert of Reduce ActiveDOMObjects from core/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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
« no previous file with comments | « third_party/WebKit/Source/core/css/MediaQueryList.h ('k') | third_party/WebKit/Source/core/css/MediaQueryListTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698