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

Side by Side Diff: third_party/WebKit/Source/core/css/MediaList.cpp

Issue 2776203002: Migrate WTF::Vector::remove() to ::erase() (Closed)
Patch Set: rebase, repatch VectorTest Created 3 years, 8 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
OLDNEW
1 /* 1 /*
2 * (C) 1999-2003 Lars Knoll (knoll@kde.org) 2 * (C) 1999-2003 Lars Knoll (knoll@kde.org)
3 * Copyright (C) 2004, 2006, 2010, 2012 Apple Inc. All rights reserved. 3 * Copyright (C) 2004, 2006, 2010, 2012 Apple Inc. All rights reserved.
4 * 4 *
5 * This library is free software; you can redistribute it and/or 5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Library General Public 6 * modify it under the terms of the GNU Library General Public
7 * License as published by the Free Software Foundation; either 7 * License as published by the Free Software Foundation; either
8 * version 2 of the License, or (at your option) any later version. 8 * version 2 of the License, or (at your option) any later version.
9 * 9 *
10 * This library is distributed in the hope that it will be useful, 10 * This library is distributed in the hope that it will be useful,
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
108 108
109 MediaQuery* newQuery = result->m_queries[0].release(); 109 MediaQuery* newQuery = result->m_queries[0].release();
110 ASSERT(newQuery); 110 ASSERT(newQuery);
111 111
112 // Remove any media query from the collection of media queries for which 112 // Remove any media query from the collection of media queries for which
113 // comparing with the media query returns true. 113 // comparing with the media query returns true.
114 bool found = false; 114 bool found = false;
115 for (size_t i = 0; i < m_queries.size(); ++i) { 115 for (size_t i = 0; i < m_queries.size(); ++i) {
116 MediaQuery* query = m_queries[i].get(); 116 MediaQuery* query = m_queries[i].get();
117 if (*query == *newQuery) { 117 if (*query == *newQuery) {
118 m_queries.remove(i); 118 m_queries.erase(i);
119 --i; 119 --i;
120 found = true; 120 found = true;
121 } 121 }
122 } 122 }
123 123
124 return found; 124 return found;
125 } 125 }
126 126
127 void MediaQuerySet::addMediaQuery(MediaQuery* mediaQuery) { 127 void MediaQuerySet::addMediaQuery(MediaQuery* mediaQuery) {
128 m_queries.push_back(mediaQuery); 128 m_queries.push_back(mediaQuery);
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
207 m_mediaQueries = mediaQueries; 207 m_mediaQueries = mediaQueries;
208 } 208 }
209 209
210 DEFINE_TRACE(MediaList) { 210 DEFINE_TRACE(MediaList) {
211 visitor->trace(m_mediaQueries); 211 visitor->trace(m_mediaQueries);
212 visitor->trace(m_parentStyleSheet); 212 visitor->trace(m_parentStyleSheet);
213 visitor->trace(m_parentRule); 213 visitor->trace(m_parentRule);
214 } 214 }
215 215
216 } // namespace blink 216 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/css/CSSValueList.cpp ('k') | third_party/WebKit/Source/core/css/MediaQuery.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698