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

Unified Diff: Source/core/css/MediaQueryListListener.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
Index: Source/core/css/MediaQueryListListener.h
diff --git a/Source/core/css/MediaQueryListListener.h b/Source/core/css/MediaQueryListListener.h
index cf0b743f99dc25fdd46476c644fd3125bc42cb7c..61d9e797ec5caa3c6dea39b353b4a6e0b0092798 100644
--- a/Source/core/css/MediaQueryListListener.h
+++ b/Source/core/css/MediaQueryListListener.h
@@ -39,7 +39,13 @@ public:
return nullptr;
return adoptRefWillBeNoop(new MediaQueryListListener(value));
}
- void queryChanged(ScriptState*, MediaQueryList*);
+
+ void call(ScriptState*);
+
+ // Used to keep the MediaQueryList alive and registered with the MediaQueryMatcher
+ // as long as the listener exists.
+ void setMediaQueryList(MediaQueryList* query) { m_query = query; }
+ void clearMediaQueryList() { m_query = nullptr; }
bool operator==(const MediaQueryListListener& other) const { return m_value == other.m_value; }
@@ -49,6 +55,7 @@ private:
explicit MediaQueryListListener(const ScriptValue& value) : m_value(value) { }
ScriptValue m_value;
+ RefPtrWillBeMember<MediaQueryList> m_query;
};
}

Powered by Google App Engine
This is Rietveld 408576698