Chromium Code Reviews| Index: Source/core/css/MediaQueryMatcher.h |
| diff --git a/Source/core/css/MediaQueryMatcher.h b/Source/core/css/MediaQueryMatcher.h |
| index abe862883b5c963708cf613ee92361dfff554b2f..03811285bfb762d2a8d9e727962a41a93a7c771c 100644 |
| --- a/Source/core/css/MediaQueryMatcher.h |
| +++ b/Source/core/css/MediaQueryMatcher.h |
| @@ -41,47 +41,31 @@ class MediaQuerySet; |
| class MediaQueryMatcher FINAL : public RefCountedWillBeGarbageCollected<MediaQueryMatcher> { |
|
Mads Ager (chromium)
2014/06/26 06:06:22
This now has an OwnPtr so it needs to be GarbageCo
|
| DECLARE_EMPTY_DESTRUCTOR_WILL_BE_REMOVED(MediaQueryMatcher); |
| public: |
| - static PassRefPtrWillBeRawPtr<MediaQueryMatcher> create(Document* document) { return adoptRefWillBeNoop(new MediaQueryMatcher(document)); } |
| - void documentDestroyed(); |
| + static PassRefPtrWillBeRawPtr<MediaQueryMatcher> create(Document& document) { return adoptRefWillBeNoop(new MediaQueryMatcher(document)); } |
| + void documentDetached(); |
| - void addListener(PassRefPtrWillBeRawPtr<MediaQueryListListener>, PassRefPtrWillBeRawPtr<MediaQueryList>); |
| - void removeListener(MediaQueryListListener*, MediaQueryList*); |
| + void addMediaQueryList(MediaQueryList*); |
| + void removeMediaQueryList(MediaQueryList*); |
| PassRefPtrWillBeRawPtr<MediaQueryList> matchMedia(const String&); |
| - unsigned evaluationRound() const { return m_evaluationRound; } |
| - void styleResolverChanged(); |
| + void mediaFeaturesChanged(); |
| bool evaluate(const MediaQuerySet*); |
| void trace(Visitor*); |
| private: |
| - class Listener FINAL : public NoBaseWillBeGarbageCollected<Listener> { |
| - public: |
| - Listener(PassRefPtrWillBeRawPtr<MediaQueryListListener>, PassRefPtrWillBeRawPtr<MediaQueryList>); |
| - void evaluate(MediaQueryEvaluator*); |
| + explicit MediaQueryMatcher(Document&); |
| - MediaQueryListListener* listener() { return m_listener.get(); } |
| - MediaQueryList* query() { return m_query.get(); } |
| - |
| - void trace(Visitor*); |
| - |
| - private: |
| - RefPtrWillBeMember<MediaQueryListListener> m_listener; |
| - RefPtrWillBeMember<MediaQueryList> m_query; |
| - }; |
| - |
| - MediaQueryMatcher(Document*); |
| - PassOwnPtr<MediaQueryEvaluator> prepareEvaluator() const; |
| AtomicString mediaType() const; |
| + PassOwnPtr<MediaQueryEvaluator> createEvaluator() const; |
| + |
| RawPtrWillBeMember<Document> m_document; |
| - WillBeHeapVector<OwnPtrWillBeMember<Listener> > m_listeners; |
| + OwnPtr<MediaQueryEvaluator> m_evaluator; |
| - // This value is incremented at style selector changes. |
| - // It is used to avoid evaluating queries more then once and to make sure |
| - // that a media query result change is notified exactly once. |
| - unsigned m_evaluationRound; |
| + typedef HeapListHashSet<RawPtrWillBeMember<MediaQueryList> > MediaQueryListSet; |
|
Mads Ager (chromium)
2014/06/26 06:06:22
This is where we should then use weak processing a
|
| + MediaQueryListSet m_mediaLists; |
| }; |
| } |