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

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

Issue 209433004: Do not zero-initialize RawPtr. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fix uses of RefPtrWillBeRawPtr Created 6 years, 9 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2011, 2012 Apple Inc. All rights reserved. 2 * Copyright (C) 2011, 2012 Apple Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
81 return m_colorWhite; 81 return m_colorWhite;
82 // Just because it is common. 82 // Just because it is common.
83 if (rgbValue == Color::black) 83 if (rgbValue == Color::black)
84 return m_colorBlack; 84 return m_colorBlack;
85 85
86 // Just wipe out the cache and start rebuilding if it gets too big. 86 // Just wipe out the cache and start rebuilding if it gets too big.
87 const unsigned maximumColorCacheSize = 512; 87 const unsigned maximumColorCacheSize = 512;
88 if (m_colorValueCache.size() > maximumColorCacheSize) 88 if (m_colorValueCache.size() > maximumColorCacheSize)
89 m_colorValueCache.clear(); 89 m_colorValueCache.clear();
90 90
91 RefPtrWillBeRawPtr<CSSPrimitiveValue> dummyValue; 91 RefPtrWillBeRawPtr<CSSPrimitiveValue> dummyValue = nullptr;
92 ColorValueCache::AddResult entry = m_colorValueCache.add(rgbValue, dummyValu e); 92 ColorValueCache::AddResult entry = m_colorValueCache.add(rgbValue, dummyValu e);
93 if (entry.isNewEntry) 93 if (entry.isNewEntry)
94 entry.storedValue->value = CSSPrimitiveValue::createColor(rgbValue); 94 entry.storedValue->value = CSSPrimitiveValue::createColor(rgbValue);
95 return entry.storedValue->value; 95 return entry.storedValue->value;
96 } 96 }
97 97
98 PassRefPtrWillBeRawPtr<CSSPrimitiveValue> CSSValuePool::createValue(double value , CSSPrimitiveValue::UnitTypes type) 98 PassRefPtrWillBeRawPtr<CSSPrimitiveValue> CSSValuePool::createValue(double value , CSSPrimitiveValue::UnitTypes type)
99 { 99 {
100 if (value < 0 || value > maximumCacheableIntegerValue) 100 if (value < 0 || value > maximumCacheableIntegerValue)
101 return CSSPrimitiveValue::create(value, type); 101 return CSSPrimitiveValue::create(value, type);
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
159 visitor->trace(m_colorWhite); 159 visitor->trace(m_colorWhite);
160 visitor->trace(m_colorBlack); 160 visitor->trace(m_colorBlack);
161 visitor->trace(m_pixelValueCache); 161 visitor->trace(m_pixelValueCache);
162 visitor->trace(m_percentValueCache); 162 visitor->trace(m_percentValueCache);
163 visitor->trace(m_numberValueCache); 163 visitor->trace(m_numberValueCache);
164 visitor->trace(m_fontFaceValueCache); 164 visitor->trace(m_fontFaceValueCache);
165 visitor->trace(m_fontFamilyValueCache); 165 visitor->trace(m_fontFamilyValueCache);
166 } 166 }
167 167
168 } 168 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698