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

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

Issue 396283004: Make the MediaQueryList listener an EventListener (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: . Created 6 years, 4 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 | « Source/core/css/MediaQueryListEvent.idl ('k') | Source/core/css/MediaQueryListListener.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/css/MediaQueryListListener.h
diff --git a/Source/core/css/MediaQueryListListener.h b/Source/core/css/MediaQueryListListener.h
index 462f55759a53ce8a5df1dd62a7162c18afd55559..aeff550067fab74d1fba1280cc9e131c517defe9 100644
--- a/Source/core/css/MediaQueryListListener.h
+++ b/Source/core/css/MediaQueryListListener.h
@@ -20,8 +20,6 @@
#ifndef MediaQueryListListener_h
#define MediaQueryListListener_h
-#include "bindings/core/v8/ScriptState.h"
-#include "bindings/core/v8/ScriptValue.h"
#include "core/css/MediaQueryList.h"
#include "platform/heap/Handle.h"
#include "wtf/RefCounted.h"
@@ -36,35 +34,21 @@ class MediaQueryList;
// is provided for this purpose.
class MediaQueryListListener : public RefCountedWillBeGarbageCollectedFinalized<MediaQueryListListener> {
public:
- static PassRefPtrWillBeRawPtr<MediaQueryListListener> create(ScriptState* scriptState, const ScriptValue& value)
- {
- if (!value.isFunction())
- return nullptr;
- return adoptRefWillBeNoop(new MediaQueryListListener(scriptState, value));
- }
virtual ~MediaQueryListListener();
- virtual void call();
+ virtual void call() = 0;
// 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.isNull() ? this == &other : m_function == other.m_function; }
-
virtual void trace(Visitor* visitor) { visitor->trace(m_query); }
protected:
MediaQueryListListener();
RefPtrWillBeMember<MediaQueryList> m_query;
-
-private:
- MediaQueryListListener(ScriptState*, const ScriptValue&);
-
- RefPtr<ScriptState> m_scriptState;
- ScriptValue m_function;
};
}
« no previous file with comments | « Source/core/css/MediaQueryListEvent.idl ('k') | Source/core/css/MediaQueryListListener.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698