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 21 matching lines...) Expand all Loading... |
32 namespace WebCore { | 32 namespace WebCore { |
33 | 33 |
34 MediaQueryMatcher::Listener::Listener(PassRefPtrWillBeRawPtr<MediaQueryListListe
ner> listener, PassRefPtrWillBeRawPtr<MediaQueryList> query) | 34 MediaQueryMatcher::Listener::Listener(PassRefPtrWillBeRawPtr<MediaQueryListListe
ner> listener, PassRefPtrWillBeRawPtr<MediaQueryList> query) |
35 : m_listener(listener) | 35 : m_listener(listener) |
36 , m_query(query) | 36 , m_query(query) |
37 { | 37 { |
38 } | 38 } |
39 | 39 |
40 void MediaQueryMatcher::Listener::evaluate(ScriptState* state, MediaQueryEvaluat
or* evaluator) | 40 void MediaQueryMatcher::Listener::evaluate(ScriptState* state, MediaQueryEvaluat
or* evaluator) |
41 { | 41 { |
42 bool notify; | 42 if (m_query->evaluate(evaluator)) |
43 m_query->evaluate(evaluator, notify); | |
44 if (notify) | |
45 m_listener->queryChanged(state, m_query.get()); | 43 m_listener->queryChanged(state, m_query.get()); |
46 } | 44 } |
47 | 45 |
48 void MediaQueryMatcher::Listener::trace(Visitor* visitor) | 46 void MediaQueryMatcher::Listener::trace(Visitor* visitor) |
49 { | 47 { |
50 visitor->trace(m_listener); | 48 visitor->trace(m_listener); |
51 visitor->trace(m_query); | 49 visitor->trace(m_query); |
52 } | 50 } |
53 | 51 |
54 MediaQueryMatcher::MediaQueryMatcher(Document* document) | 52 MediaQueryMatcher::MediaQueryMatcher(Document* document) |
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
156 void MediaQueryMatcher::trace(Visitor* visitor) | 154 void MediaQueryMatcher::trace(Visitor* visitor) |
157 { | 155 { |
158 // We don't support tracing of vectors of OwnPtrs (ie. Vector<OwnPtr<Listene
r> >). | 156 // We don't support tracing of vectors of OwnPtrs (ie. Vector<OwnPtr<Listene
r> >). |
159 // Since this is a transitional object we are just ifdef'ing it out when oil
pan is not enabled. | 157 // Since this is a transitional object we are just ifdef'ing it out when oil
pan is not enabled. |
160 #if ENABLE(OILPAN) | 158 #if ENABLE(OILPAN) |
161 visitor->trace(m_listeners); | 159 visitor->trace(m_listeners); |
162 #endif | 160 #endif |
163 } | 161 } |
164 | 162 |
165 } | 163 } |
OLD | NEW |