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

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

Issue 348893004: Rework MediaQueryMatcher to batch up listener notification (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: ordering test 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.cpp
diff --git a/Source/core/css/MediaQueryListListener.cpp b/Source/core/css/MediaQueryListListener.cpp
index 16ddd1968538f73c199393cc8547b5dabaafb234..4a6d21a999838441a54b1608a45ee1069bdd57ce 100644
--- a/Source/core/css/MediaQueryListListener.cpp
+++ b/Source/core/css/MediaQueryListListener.cpp
@@ -33,12 +33,15 @@ MediaQueryListListener::MediaQueryListListener(ScriptState* scriptState, const S
ASSERT(m_function.isFunction());
}
-void MediaQueryListListener::queryChanged(MediaQueryList* query)
+void MediaQueryListListener::call()
{
+ if (!m_query)
+ return;
+
if (m_scriptState->contextIsEmpty())
return;
ScriptState::Scope scope(m_scriptState.get());
- v8::Handle<v8::Value> args[] = { toV8(query, m_scriptState->context()->Global(), m_scriptState->isolate()) };
+ v8::Handle<v8::Value> args[] = { toV8(m_query.get(), m_scriptState->context()->Global(), m_scriptState->isolate()) };
ScriptController::callFunction(m_scriptState->executionContext(), v8::Handle<v8::Function>::Cast(m_function.v8Value()), m_scriptState->context()->Global(), WTF_ARRAY_LENGTH(args), args, m_scriptState->isolate());
}

Powered by Google App Engine
This is Rietveld 408576698