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

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

Issue 368533003: Revert of Call media query change listeners asynchronously. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 5 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/MediaQueryList.h ('k') | Source/core/css/MediaQueryListListener.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 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
79 break; 79 break;
80 } 80 }
81 } 81 }
82 } 82 }
83 83
84 void MediaQueryList::documentDetached() 84 void MediaQueryList::documentDetached()
85 { 85 {
86 m_listeners.clear(); 86 m_listeners.clear();
87 } 87 }
88 88
89 void MediaQueryList::mediaFeaturesChanged(WillBeHeapVector<RefPtrWillBeMember<Me diaQueryListListener> >* listenersToNotify) 89 void MediaQueryList::mediaFeaturesChanged(WillBeHeapVector<RefPtrWillBeMember<Me diaQueryListListener> >* toNotify)
90 { 90 {
91 m_matchesDirty = true; 91 m_matchesDirty = true;
92 if (!updateMatches()) 92 if (!updateMatches())
93 return; 93 return;
94 for (ListenerList::const_iterator it = m_listeners.begin(), end = m_listener s.end(); it != end; ++it) { 94 for (ListenerList::const_iterator it = m_listeners.begin(), end = m_listener s.end(); it != end; ++it) {
95 listenersToNotify->append(*it); 95 toNotify->append(*it);
96 } 96 }
97 } 97 }
98 98
99 bool MediaQueryList::updateMatches() 99 bool MediaQueryList::updateMatches()
100 { 100 {
101 m_matchesDirty = false; 101 m_matchesDirty = false;
102 if (m_matches != m_matcher->evaluate(m_media.get())) { 102 if (m_matches != m_matcher->evaluate(m_media.get())) {
103 m_matches = !m_matches; 103 m_matches = !m_matches;
104 return true; 104 return true;
105 } 105 }
106 return false; 106 return false;
107 } 107 }
108 108
109 bool MediaQueryList::matches() 109 bool MediaQueryList::matches()
110 { 110 {
111 updateMatches(); 111 updateMatches();
112 return m_matches; 112 return m_matches;
113 } 113 }
114 114
115 void MediaQueryList::trace(Visitor* visitor) 115 void MediaQueryList::trace(Visitor* visitor)
116 { 116 {
117 visitor->trace(m_matcher); 117 visitor->trace(m_matcher);
118 visitor->trace(m_media); 118 visitor->trace(m_media);
119 visitor->trace(m_listeners); 119 visitor->trace(m_listeners);
120 } 120 }
121 121
122 } 122 }
OLDNEW
« no previous file with comments | « Source/core/css/MediaQueryList.h ('k') | Source/core/css/MediaQueryListListener.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698