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

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

Issue 348893004: Rework MediaQueryMatcher to batch up listener notification (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: missed one... Created 6 years, 6 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 259aaeaa575b33525df773366249d9708b7e71ae..d9299b0b3d650dd345c4febcb4dc8022ea23a282 100644
--- a/Source/core/css/MediaQueryListListener.h
+++ b/Source/core/css/MediaQueryListListener.h
@@ -39,17 +39,23 @@ public:
return nullptr;
return adoptRefWillBeNoop(new MediaQueryListListener(scriptState, value));
}
- void queryChanged(MediaQueryList*);
+ void call();
+
+ // 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_function == other.m_function; }
- void trace(Visitor*) { }
+ void trace(Visitor* visitor) { visitor->trace(m_query); }
private:
MediaQueryListListener(ScriptState*, const ScriptValue&);
RefPtr<ScriptState> m_scriptState;
ScriptValue m_function;
+ RefPtrWillBeMember<MediaQueryList> m_query;
};
}

Powered by Google App Engine
This is Rietveld 408576698