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

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

Issue 397403002: Make MediaQueryList an ActiveDOMElement (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: need ActiveDOMObject in IDL Created 6 years, 5 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
« no previous file with comments | « Source/core/css/MediaQueryList.h ('k') | Source/core/css/MediaQueryList.idl » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/css/MediaQueryList.cpp
diff --git a/Source/core/css/MediaQueryList.cpp b/Source/core/css/MediaQueryList.cpp
index 8ded50e13a2172e92f45499388901341e4593eb4..f21c99006e607f37c81dcf7ac24c23608039ddb1 100644
--- a/Source/core/css/MediaQueryList.cpp
+++ b/Source/core/css/MediaQueryList.cpp
@@ -27,13 +27,16 @@
namespace blink {
-PassRefPtrWillBeRawPtr<MediaQueryList> MediaQueryList::create(PassRefPtrWillBeRawPtr<MediaQueryMatcher> matcher, PassRefPtrWillBeRawPtr<MediaQuerySet> media)
+PassRefPtrWillBeRawPtr<MediaQueryList> MediaQueryList::create(ExecutionContext* context, PassRefPtrWillBeRawPtr<MediaQueryMatcher> matcher, PassRefPtrWillBeRawPtr<MediaQuerySet> media)
{
- return adoptRefWillBeNoop(new MediaQueryList(matcher, media));
+ RefPtrWillBeRawPtr<MediaQueryList> list = adoptRefWillBeNoop(new MediaQueryList(context, matcher, media));
+ list->suspendIfNeeded();
+ return list.release();
}
-MediaQueryList::MediaQueryList(PassRefPtrWillBeRawPtr<MediaQueryMatcher> matcher, PassRefPtrWillBeRawPtr<MediaQuerySet> media)
- : m_matcher(matcher)
+MediaQueryList::MediaQueryList(ExecutionContext* context, PassRefPtrWillBeRawPtr<MediaQueryMatcher> matcher, PassRefPtrWillBeRawPtr<MediaQuerySet> media)
+ : ActiveDOMObject(context)
+ , m_matcher(matcher)
, m_media(media)
, m_matchesDirty(true)
, m_matches(false)
@@ -81,7 +84,12 @@ void MediaQueryList::removeListener(PassRefPtrWillBeRawPtr<MediaQueryListListene
}
}
-void MediaQueryList::documentDetached()
+bool MediaQueryList::hasPendingActivity() const
+{
+ return m_listeners.size();
+}
+
+void MediaQueryList::stop()
{
m_listeners.clear();
}
« no previous file with comments | « Source/core/css/MediaQueryList.h ('k') | Source/core/css/MediaQueryList.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698