| 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 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 50 | 50 |
| 51 PassRefPtrWillBeRawPtr<MediaQueryList> matchMedia(const String&); | 51 PassRefPtrWillBeRawPtr<MediaQueryList> matchMedia(const String&); |
| 52 | 52 |
| 53 unsigned evaluationRound() const { return m_evaluationRound; } | 53 unsigned evaluationRound() const { return m_evaluationRound; } |
| 54 void styleResolverChanged(); | 54 void styleResolverChanged(); |
| 55 bool evaluate(const MediaQuerySet*); | 55 bool evaluate(const MediaQuerySet*); |
| 56 | 56 |
| 57 void trace(Visitor*); | 57 void trace(Visitor*); |
| 58 | 58 |
| 59 private: | 59 private: |
| 60 class Listener : public NoBaseWillBeGarbageCollected<Listener> { | 60 class Listener FINAL : public NoBaseWillBeGarbageCollected<Listener> { |
| 61 public: | 61 public: |
| 62 Listener(PassRefPtrWillBeRawPtr<MediaQueryListListener>, PassRefPtrWillB
eRawPtr<MediaQueryList>); | 62 Listener(PassRefPtrWillBeRawPtr<MediaQueryListListener>, PassRefPtrWillB
eRawPtr<MediaQueryList>); |
| 63 ~Listener(); | |
| 64 void evaluate(ScriptState*, MediaQueryEvaluator*); | 63 void evaluate(ScriptState*, MediaQueryEvaluator*); |
| 65 | 64 |
| 66 MediaQueryListListener* listener() { return m_listener.get(); } | 65 MediaQueryListListener* listener() { return m_listener.get(); } |
| 67 MediaQueryList* query() { return m_query.get(); } | 66 MediaQueryList* query() { return m_query.get(); } |
| 68 | 67 |
| 69 void trace(Visitor*); | 68 void trace(Visitor*); |
| 70 | 69 |
| 71 private: | 70 private: |
| 72 RefPtrWillBeMember<MediaQueryListListener> m_listener; | 71 RefPtrWillBeMember<MediaQueryListListener> m_listener; |
| 73 RefPtrWillBeMember<MediaQueryList> m_query; | 72 RefPtrWillBeMember<MediaQueryList> m_query; |
| 74 }; | 73 }; |
| 75 | 74 |
| 76 MediaQueryMatcher(Document*); | 75 MediaQueryMatcher(Document*); |
| 77 PassOwnPtr<MediaQueryEvaluator> prepareEvaluator() const; | 76 PassOwnPtr<MediaQueryEvaluator> prepareEvaluator() const; |
| 78 AtomicString mediaType() const; | 77 AtomicString mediaType() const; |
| 79 | 78 |
| 80 Document* m_document; | 79 Document* m_document; |
| 81 WillBeHeapVector<OwnPtrWillBeMember<Listener> > m_listeners; | 80 WillBeHeapVector<OwnPtrWillBeMember<Listener> > m_listeners; |
| 82 | 81 |
| 83 // This value is incremented at style selector changes. | 82 // This value is incremented at style selector changes. |
| 84 // It is used to avoid evaluating queries more then once and to make sure | 83 // It is used to avoid evaluating queries more then once and to make sure |
| 85 // that a media query result change is notified exactly once. | 84 // that a media query result change is notified exactly once. |
| 86 unsigned m_evaluationRound; | 85 unsigned m_evaluationRound; |
| 87 }; | 86 }; |
| 88 | 87 |
| 89 } | 88 } |
| 90 | 89 |
| 91 #endif // MediaQueryMatcher_h | 90 #endif // MediaQueryMatcher_h |
| OLD | NEW |