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

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

Issue 1485353006: Oilpan: no destructor needed for CSSPrimitiveValue. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years 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 | « third_party/WebKit/Source/core/css/CSSPrimitiveValue.h ('k') | no next file » | 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 * (C) 1999-2003 Lars Knoll (knoll@kde.org) 2 * (C) 1999-2003 Lars Knoll (knoll@kde.org)
3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2012 Apple Inc. All rights reserv ed. 3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2012 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 282 matching lines...) Expand 10 before | Expand all | Expand 10 after
293 293
294 void CSSPrimitiveValue::init(PassRefPtrWillBeRawPtr<CSSCalcValue> c) 294 void CSSPrimitiveValue::init(PassRefPtrWillBeRawPtr<CSSCalcValue> c)
295 { 295 {
296 init(UnitType::Calc); 296 init(UnitType::Calc);
297 m_hasCachedCSSText = false; 297 m_hasCachedCSSText = false;
298 m_value.calc = c.leakRef(); 298 m_value.calc = c.leakRef();
299 } 299 }
300 300
301 CSSPrimitiveValue::~CSSPrimitiveValue() 301 CSSPrimitiveValue::~CSSPrimitiveValue()
302 { 302 {
303 cleanup(); 303 #if !ENABLE(OILPAN)
304 }
305
306 void CSSPrimitiveValue::cleanup()
307 {
308 switch (type()) { 304 switch (type()) {
309 case UnitType::Calc: 305 case UnitType::Calc:
310 // We must not call deref() when oilpan is enabled because m_value.calc is traced. 306 // We must not call deref() when oilpan is enabled because m_value.calc is traced.
311 #if !ENABLE(OILPAN)
312 m_value.calc->deref(); 307 m_value.calc->deref();
313 #endif
314 break; 308 break;
315 case UnitType::CalcPercentageWithNumber: 309 case UnitType::CalcPercentageWithNumber:
316 case UnitType::CalcPercentageWithLength: 310 case UnitType::CalcPercentageWithLength:
317 ASSERT_NOT_REACHED(); 311 ASSERT_NOT_REACHED();
318 break; 312 break;
319 case UnitType::Number: 313 case UnitType::Number:
320 case UnitType::Integer: 314 case UnitType::Integer:
321 case UnitType::Percentage: 315 case UnitType::Percentage:
322 case UnitType::Ems: 316 case UnitType::Ems:
323 case UnitType::QuirkyEms: 317 case UnitType::QuirkyEms:
(...skipping 24 matching lines...) Expand all
348 case UnitType::DotsPerCentimeter: 342 case UnitType::DotsPerCentimeter:
349 case UnitType::Fraction: 343 case UnitType::Fraction:
350 case UnitType::Unknown: 344 case UnitType::Unknown:
351 case UnitType::ValueID: 345 case UnitType::ValueID:
352 break; 346 break;
353 } 347 }
354 if (m_hasCachedCSSText) { 348 if (m_hasCachedCSSText) {
355 cssTextCache().remove(this); 349 cssTextCache().remove(this);
356 m_hasCachedCSSText = false; 350 m_hasCachedCSSText = false;
357 } 351 }
352 #endif
358 } 353 }
359 354
360 double CSSPrimitiveValue::computeSeconds() const 355 double CSSPrimitiveValue::computeSeconds() const
361 { 356 {
362 ASSERT(isTime() || (isCalculated() && cssCalcValue()->category() == CalcTime )); 357 ASSERT(isTime() || (isCalculated() && cssCalcValue()->category() == CalcTime ));
363 UnitType currentType = isCalculated() ? cssCalcValue()->expressionNode()->ty peWithCalcResolved() : type(); 358 UnitType currentType = isCalculated() ? cssCalcValue()->expressionNode()->ty peWithCalcResolved() : type();
364 if (currentType == UnitType::Seconds) 359 if (currentType == UnitType::Seconds)
365 return getDoubleValue(); 360 return getDoubleValue();
366 if (currentType == UnitType::Milliseconds) 361 if (currentType == UnitType::Milliseconds)
367 return getDoubleValue() / 1000; 362 return getDoubleValue() / 1000;
(...skipping 475 matching lines...) Expand 10 before | Expand all | Expand 10 after
843 visitor->trace(m_value.calc); 838 visitor->trace(m_value.calc);
844 break; 839 break;
845 default: 840 default:
846 break; 841 break;
847 } 842 }
848 #endif 843 #endif
849 CSSValue::traceAfterDispatch(visitor); 844 CSSValue::traceAfterDispatch(visitor);
850 } 845 }
851 846
852 } // namespace blink 847 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/css/CSSPrimitiveValue.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698