OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies) | 2 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies) |
3 * | 3 * |
4 * This library is free software; you can redistribute it and/or | 4 * This library is free software; you can redistribute it and/or |
5 * modify it under the terms of the GNU Library General Public | 5 * modify it under the terms of the GNU Library General Public |
6 * License as published by the Free Software Foundation; either | 6 * License as published by the Free Software Foundation; either |
7 * version 2 of the License, or (at your option) any later version. | 7 * version 2 of the License, or (at your option) any later version. |
8 * | 8 * |
9 * This library is distributed in the hope that it will be useful, | 9 * This library is distributed in the hope that it will be useful, |
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
(...skipping 12 matching lines...) Expand all Loading... | |
23 #include "bindings/v8/ScriptState.h" | 23 #include "bindings/v8/ScriptState.h" |
24 #include "bindings/v8/ScriptValue.h" | 24 #include "bindings/v8/ScriptValue.h" |
25 #include "platform/heap/Handle.h" | 25 #include "platform/heap/Handle.h" |
26 #include "wtf/RefCounted.h" | 26 #include "wtf/RefCounted.h" |
27 | 27 |
28 namespace WebCore { | 28 namespace WebCore { |
29 | 29 |
30 class MediaQueryList; | 30 class MediaQueryList; |
31 | 31 |
32 // See http://dev.w3.org/csswg/cssom-view/#the-mediaquerylist-interface | 32 // See http://dev.w3.org/csswg/cssom-view/#the-mediaquerylist-interface |
33 | 33 // FIXME: MediaQueryListListener should be implemented using callback interface |
haraken
2014/06/24 03:58:51
Yes, and we should remove special-casing for Media
| |
34 class MediaQueryListListener : public RefCountedWillBeGarbageCollectedFinalized< MediaQueryListListener> { | 34 class MediaQueryListListener : public RefCountedWillBeGarbageCollectedFinalized< MediaQueryListListener> { |
35 public: | 35 public: |
36 static PassRefPtrWillBeRawPtr<MediaQueryListListener> create(ScriptState* sc riptState, const ScriptValue& value) | 36 static PassRefPtrWillBeRawPtr<MediaQueryListListener> create(ScriptState* sc riptState, const ScriptValue& value) |
37 { | 37 { |
38 if (!value.isFunction()) | 38 if (!value.isFunction()) |
39 return nullptr; | 39 return nullptr; |
40 return adoptRefWillBeNoop(new MediaQueryListListener(scriptState, value) ); | 40 return adoptRefWillBeNoop(new MediaQueryListListener(scriptState, value) ); |
41 } | 41 } |
42 void queryChanged(MediaQueryList*); | 42 void queryChanged(MediaQueryList*); |
43 | 43 |
44 bool operator==(const MediaQueryListListener& other) const { return m_functi on == other.m_function; } | 44 bool operator==(const MediaQueryListListener& other) const { return m_functi on == other.m_function; } |
45 | 45 |
46 void trace(Visitor*) { } | 46 void trace(Visitor*) { } |
47 | 47 |
48 private: | 48 private: |
49 MediaQueryListListener(ScriptState*, const ScriptValue&); | 49 MediaQueryListListener(ScriptState*, const ScriptValue&); |
50 | 50 |
51 RefPtr<ScriptState> m_scriptState; | 51 RefPtr<ScriptState> m_scriptState; |
52 ScriptValue m_function; | 52 ScriptValue m_function; |
53 }; | 53 }; |
54 | 54 |
55 } | 55 } |
56 | 56 |
57 #endif // MediaQueryListListener_h | 57 #endif // MediaQueryListListener_h |
OLD | NEW |