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

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

Issue 645743003: Use C++11 range-based loop for core/css (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: better variable names Created 6 years, 2 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/FontLoader.cpp ('k') | Source/core/css/MediaQueryMatcher.cpp » ('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 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
96 RefPtrWillBeRawPtr<MediaQueryList> protect(this); 96 RefPtrWillBeRawPtr<MediaQueryList> protect(this);
97 m_listeners.clear(); 97 m_listeners.clear();
98 removeAllEventListeners(); 98 removeAllEventListeners();
99 } 99 }
100 100
101 bool MediaQueryList::mediaFeaturesChanged(WillBeHeapVector<RefPtrWillBeMember<Me diaQueryListListener> >* listenersToNotify) 101 bool MediaQueryList::mediaFeaturesChanged(WillBeHeapVector<RefPtrWillBeMember<Me diaQueryListListener> >* listenersToNotify)
102 { 102 {
103 m_matchesDirty = true; 103 m_matchesDirty = true;
104 if (!updateMatches()) 104 if (!updateMatches())
105 return false; 105 return false;
106 for (ListenerList::const_iterator it = m_listeners.begin(), end = m_listener s.end(); it != end; ++it) { 106 for (const auto& listener : m_listeners) {
107 listenersToNotify->append(*it); 107 listenersToNotify->append(listener);
108 } 108 }
109 return hasEventListeners(EventTypeNames::change); 109 return hasEventListeners(EventTypeNames::change);
110 } 110 }
111 111
112 bool MediaQueryList::updateMatches() 112 bool MediaQueryList::updateMatches()
113 { 113 {
114 m_matchesDirty = false; 114 m_matchesDirty = false;
115 if (m_matches != m_matcher->evaluate(m_media.get())) { 115 if (m_matches != m_matcher->evaluate(m_media.get())) {
116 m_matches = !m_matches; 116 m_matches = !m_matches;
117 return true; 117 return true;
(...skipping 21 matching lines...) Expand all
139 { 139 {
140 return EventTargetNames::MediaQueryList; 140 return EventTargetNames::MediaQueryList;
141 } 141 }
142 142
143 ExecutionContext* MediaQueryList::executionContext() const 143 ExecutionContext* MediaQueryList::executionContext() const
144 { 144 {
145 return ActiveDOMObject::executionContext(); 145 return ActiveDOMObject::executionContext();
146 } 146 }
147 147
148 } 148 }
OLDNEW
« no previous file with comments | « Source/core/css/FontLoader.cpp ('k') | Source/core/css/MediaQueryMatcher.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698