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

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

Issue 214383008: Rework MediaQueryMatcher to batch up listener notification (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 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
« no previous file with comments | « no previous file | Source/core/css/MediaQueryList.cpp » ('j') | Source/core/css/MediaQueryMatcher.cpp » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/css/MediaQueryList.h
diff --git a/Source/core/css/MediaQueryList.h b/Source/core/css/MediaQueryList.h
index e832f29dde4bb242cb5f676ee774639fb81e3c4d..30af2cf0ad455891dcf432f52bf8a010f5182c89 100644
--- a/Source/core/css/MediaQueryList.h
+++ b/Source/core/css/MediaQueryList.h
@@ -38,27 +38,33 @@ class MediaQuerySet;
// will be called whenever the value of the query changes.
class MediaQueryList FINAL : public RefCountedWillBeGarbageCollected<MediaQueryList> {
- DECLARE_EMPTY_DESTRUCTOR_WILL_BE_REMOVED(MediaQueryList);
public:
- static PassRefPtrWillBeRawPtr<MediaQueryList> create(PassRefPtrWillBeRawPtr<MediaQueryMatcher>, PassRefPtrWillBeRawPtr<MediaQuerySet>, bool);
+ static PassRefPtrWillBeRawPtr<MediaQueryList> create(PassRefPtrWillBeRawPtr<MediaQueryMatcher>, PassRefPtrWillBeRawPtr<MediaQuerySet>);
String media() const;
bool matches();
void addListener(PassRefPtrWillBeRawPtr<MediaQueryListListener>);
void removeListener(PassRefPtrWillBeRawPtr<MediaQueryListListener>);
- bool evaluate(MediaQueryEvaluator*);
+ void mediaChanged(WillBeHeapVector<RefPtrWillBeMember<MediaQueryListListener> > toNotify);
void trace(Visitor*);
+ void documentDetached();
+
private:
- MediaQueryList(PassRefPtrWillBeRawPtr<MediaQueryMatcher>, PassRefPtrWillBeRawPtr<MediaQuerySet>, bool matches);
- void setMatches(bool);
+ MediaQueryList(PassRefPtrWillBeRawPtr<MediaQueryMatcher>, PassRefPtrWillBeRawPtr<MediaQuerySet>);
+ ~MediaQueryList();
+
+ bool updateMatches();
RefPtrWillBeMember<MediaQueryMatcher> m_matcher;
RefPtrWillBeMember<MediaQuerySet> m_media;
- unsigned m_evaluationRound; // Indicates if the query has been evaluated after the last style selector change.
- unsigned m_changeRound; // Used to know if the query has changed in the last style selector change.
+
+ // FIXME: This should be a HeapListHashSet when oilpan supports it.
+ ListHashSet<RefPtrWillBePersistent<MediaQueryListListener> > m_listeners;
+
+ bool m_matchesDirty;
bool m_matches;
};
« no previous file with comments | « no previous file | Source/core/css/MediaQueryList.cpp » ('j') | Source/core/css/MediaQueryMatcher.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698