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

Side by Side Diff: Source/core/css/MediaQueryMatcher.cpp

Issue 170283019: Change various helper classes to transition types to get CSSValue entirely onto the gc heap. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebase and revert member to persistent in StorageEvent Created 6 years, 9 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
96 96
97 OwnPtr<MediaQueryEvaluator> evaluator(prepareEvaluator()); 97 OwnPtr<MediaQueryEvaluator> evaluator(prepareEvaluator());
98 return evaluator && evaluator->eval(media); 98 return evaluator && evaluator->eval(media);
99 } 99 }
100 100
101 PassRefPtr<MediaQueryList> MediaQueryMatcher::matchMedia(const String& query) 101 PassRefPtr<MediaQueryList> MediaQueryMatcher::matchMedia(const String& query)
102 { 102 {
103 if (!m_document) 103 if (!m_document)
104 return nullptr; 104 return nullptr;
105 105
106 RefPtr<MediaQuerySet> media = MediaQuerySet::create(query); 106 RefPtrWillBeRawPtr<MediaQuerySet> media = MediaQuerySet::create(query);
107 // Add warning message to inspector whenever dpi/dpcm values are used for "s creen" media. 107 // Add warning message to inspector whenever dpi/dpcm values are used for "s creen" media.
108 reportMediaQueryWarningIfNeeded(m_document, media.get()); 108 reportMediaQueryWarningIfNeeded(m_document, media.get());
109 return MediaQueryList::create(this, media, evaluate(media.get())); 109 return MediaQueryList::create(this, media, evaluate(media.get()));
110 } 110 }
111 111
112 void MediaQueryMatcher::addListener(PassRefPtr<MediaQueryListListener> listener, PassRefPtr<MediaQueryList> query) 112 void MediaQueryMatcher::addListener(PassRefPtr<MediaQueryListListener> listener, PassRefPtr<MediaQueryList> query)
113 { 113 {
114 if (!m_document) 114 if (!m_document)
115 return; 115 return;
116 116
(...skipping 30 matching lines...) Expand all
147 ++m_evaluationRound; 147 ++m_evaluationRound;
148 OwnPtr<MediaQueryEvaluator> evaluator = prepareEvaluator(); 148 OwnPtr<MediaQueryEvaluator> evaluator = prepareEvaluator();
149 if (!evaluator) 149 if (!evaluator)
150 return; 150 return;
151 151
152 for (size_t i = 0; i < m_listeners.size(); ++i) 152 for (size_t i = 0; i < m_listeners.size(); ++i)
153 m_listeners[i]->evaluate(scriptState, evaluator.get()); 153 m_listeners[i]->evaluate(scriptState, evaluator.get());
154 } 154 }
155 155
156 } 156 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698