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

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

Issue 1919663002: Unify and generalize thread static persistent finalization. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebased Created 4 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 | third_party/WebKit/Source/platform/heap/Handle.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) 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 20 matching lines...) Expand all
31 #include "platform/heap/Handle.h" 31 #include "platform/heap/Handle.h"
32 #include "wtf/Threading.h" 32 #include "wtf/Threading.h"
33 33
34 namespace blink { 34 namespace blink {
35 35
36 CSSValuePool& cssValuePool() 36 CSSValuePool& cssValuePool()
37 { 37 {
38 DEFINE_THREAD_SAFE_STATIC_LOCAL(ThreadSpecific<Persistent<CSSValuePool>>, th readSpecificPool, new ThreadSpecific<Persistent<CSSValuePool>>()); 38 DEFINE_THREAD_SAFE_STATIC_LOCAL(ThreadSpecific<Persistent<CSSValuePool>>, th readSpecificPool, new ThreadSpecific<Persistent<CSSValuePool>>());
39 Persistent<CSSValuePool>& poolHandle = *threadSpecificPool; 39 Persistent<CSSValuePool>& poolHandle = *threadSpecificPool;
40 if (!poolHandle) { 40 if (!poolHandle) {
41 poolHandle = new CSSValuePool(); 41 poolHandle = new CSSValuePool;
42 poolHandle.clearOnThreadShutdown(); 42 poolHandle.registerAsStaticReference();
43 } 43 }
44 return *poolHandle; 44 return *poolHandle;
45 } 45 }
46 46
47 CSSValuePool::CSSValuePool() 47 CSSValuePool::CSSValuePool()
48 : m_inheritedValue(CSSInheritedValue::create()) 48 : m_inheritedValue(CSSInheritedValue::create())
49 , m_implicitInitialValue(CSSInitialValue::createImplicit()) 49 , m_implicitInitialValue(CSSInitialValue::createImplicit())
50 , m_explicitInitialValue(CSSInitialValue::createExplicit()) 50 , m_explicitInitialValue(CSSInitialValue::createExplicit())
51 , m_unsetValue(CSSUnsetValue::create()) 51 , m_unsetValue(CSSUnsetValue::create())
52 , m_colorTransparent(CSSColorValue::create(Color::transparent)) 52 , m_colorTransparent(CSSColorValue::create(Color::transparent))
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
172 visitor->trace(m_colorWhite); 172 visitor->trace(m_colorWhite);
173 visitor->trace(m_colorBlack); 173 visitor->trace(m_colorBlack);
174 visitor->trace(m_pixelValueCache); 174 visitor->trace(m_pixelValueCache);
175 visitor->trace(m_percentValueCache); 175 visitor->trace(m_percentValueCache);
176 visitor->trace(m_numberValueCache); 176 visitor->trace(m_numberValueCache);
177 visitor->trace(m_fontFaceValueCache); 177 visitor->trace(m_fontFaceValueCache);
178 visitor->trace(m_fontFamilyValueCache); 178 visitor->trace(m_fontFamilyValueCache);
179 } 179 }
180 180
181 } // namespace blink 181 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/platform/heap/Handle.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698