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

Side by Side Diff: Source/core/css/CSSParserValues.h

Issue 277433002: MQParser memory leak fix (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Renamed clear to clearAndLeakValues Created 6 years, 7 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
« no previous file with comments | « no previous file | Source/core/css/CSSParserValues.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) 2003 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 2003 Lars Knoll (knoll@kde.org)
3 * Copyright (C) 2004, 2005, 2006, 2008, 2009, 2010 Apple Inc. All rights reserv ed. 3 * Copyright (C) 2004, 2005, 2006, 2008, 2009, 2010 Apple Inc. All rights reserv ed.
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 177 matching lines...) Expand 10 before | Expand all | Expand 10 after
188 } 188 }
189 void setCurrentIndex(unsigned index) 189 void setCurrentIndex(unsigned index)
190 { 190 {
191 ASSERT(index < m_values.size()); 191 ASSERT(index < m_values.size());
192 if (index < m_values.size()) 192 if (index < m_values.size())
193 m_current = index; 193 m_current = index;
194 } 194 }
195 195
196 CSSParserValue* valueAt(unsigned i) { return i < m_values.size() ? &m_values [i] : 0; } 196 CSSParserValue* valueAt(unsigned i) { return i < m_values.size() ? &m_values [i] : 0; }
197 197
198 void clear() { m_values.clear(); m_current = 0;} 198 void clearAndLeakValues() { m_values.clear(); m_current = 0;}
199 void destroyAndClear();
199 200
200 private: 201 private:
201 unsigned m_current; 202 unsigned m_current;
202 Vector<CSSParserValue, 4> m_values; 203 Vector<CSSParserValue, 4> m_values;
203 }; 204 };
204 205
205 struct CSSParserFunction { 206 struct CSSParserFunction {
206 WTF_MAKE_FAST_ALLOCATED; 207 WTF_MAKE_FAST_ALLOCATED;
207 public: 208 public:
208 CSSParserString name; 209 CSSParserString name;
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
278 inline void CSSParserValue::setFromValueList(PassOwnPtr<CSSParserValueList> valu eList) 279 inline void CSSParserValue::setFromValueList(PassOwnPtr<CSSParserValueList> valu eList)
279 { 280 {
280 id = CSSValueInvalid; 281 id = CSSValueInvalid;
281 this->valueList = valueList.leakPtr(); 282 this->valueList = valueList.leakPtr();
282 unit = ValueList; 283 unit = ValueList;
283 } 284 }
284 285
285 } 286 }
286 287
287 #endif 288 #endif
OLDNEW
« no previous file with comments | « no previous file | Source/core/css/CSSParserValues.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698