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

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

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.cpp
diff --git a/Source/core/css/MediaQueryListListener.cpp b/Source/core/css/MediaQueryListListener.cpp
index 494883e7ed8d262024155d64bf7e25d5d867b315..8467e76890281534a9b769ba53da487158887258 100644
--- a/Source/core/css/MediaQueryListListener.cpp
+++ b/Source/core/css/MediaQueryListListener.cpp
@@ -25,8 +25,11 @@
namespace WebCore {
-void MediaQueryListListener::queryChanged(ScriptState* state, MediaQueryList* query)
+void MediaQueryListListener::call(ScriptState* state)
{
+ if (!m_query)
+ return;
+
ScriptCallback callback(state, m_value);
v8::HandleScope handleScope(state->isolate());
@@ -35,7 +38,7 @@ void MediaQueryListListener::queryChanged(ScriptState* state, MediaQueryList* qu
return; // JS may not be enabled.
v8::Context::Scope scope(context);
- callback.appendArgument(ScriptValue(toV8(query, v8::Handle<v8::Object>(), context->GetIsolate()), context->GetIsolate()));
+ callback.appendArgument(ScriptValue(toV8(m_query.get(), v8::Handle<v8::Object>(), context->GetIsolate()), context->GetIsolate()));
callback.call();
}

Powered by Google App Engine
This is Rietveld 408576698