Chromium Code Reviews| Index: third_party/WebKit/Source/core/style/ComputedStyle.h |
| diff --git a/third_party/WebKit/Source/core/style/ComputedStyle.h b/third_party/WebKit/Source/core/style/ComputedStyle.h |
| index a3f659a41fe1b3f9ff0251d9893730b1ff95ac0c..4599ef51fc2f6a888c06bb0d67f00391827c269e 100644 |
| --- a/third_party/WebKit/Source/core/style/ComputedStyle.h |
| +++ b/third_party/WebKit/Source/core/style/ComputedStyle.h |
| @@ -383,20 +383,25 @@ protected: |
| private: |
| // TODO(sashab): Move these to the bottom of ComputedStyle. |
| - ALWAYS_INLINE ComputedStyle(); |
| + ComputedStyle(); |
| enum InitialStyleTag { |
| InitialStyle |
| }; |
| - ALWAYS_INLINE explicit ComputedStyle(InitialStyleTag); |
| - ALWAYS_INLINE ComputedStyle(const ComputedStyle&); |
| + explicit ComputedStyle(InitialStyleTag); |
| + ComputedStyle(const ComputedStyle&); |
| static PassRefPtr<ComputedStyle> createInitialStyle(); |
| - static inline ComputedStyle& mutableInitialStyle() |
| + static ComputedStyle& mutableInitialStyle() |
| { |
| LEAK_SANITIZER_DISABLED_SCOPE; |
| - DEFINE_STATIC_REF(ComputedStyle, s_initialStyle, (ComputedStyle::createInitialStyle())); |
| - return *s_initialStyle; |
| + |
| + DEFINE_THREAD_SAFE_STATIC_LOCAL(ThreadSpecific<ComputedStyle*>, s_initialStyle, |
| + new ThreadSpecific<ComputedStyle*>()); |
|
esprehn
2016/09/12 20:53:12
Can't put TLS here, it's too slow
|
| + if (!*s_initialStyle) { |
| + *s_initialStyle = PassRefPtr<ComputedStyle>(ComputedStyle::createInitialStyle()).leakRef(); |
| + } |
| + return **s_initialStyle; |
| } |
| public: |