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

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

Issue 170603003: Use nullptr_t for RefPtr, PassRefPtr and RawPtr. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Final rebase Created 6 years, 10 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
« no previous file with comments | « Source/core/css/MediaQueryListListener.h ('k') | Source/core/css/Pair.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
94 if (!media) 94 if (!media)
95 return false; 95 return false;
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 0; 104 return nullptr;
105 105
106 RefPtr<MediaQuerySet> media = MediaQuerySet::create(query); 106 RefPtr<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)
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
« no previous file with comments | « Source/core/css/MediaQueryListListener.h ('k') | Source/core/css/Pair.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698