RenderTheme does not need to be per-page
[WebKit-https.git] / Source / WebCore / rendering / RenderThemeWin.cpp
index 5222090..75f10ea 100644 (file)
@@ -188,10 +188,10 @@ Ref<RenderTheme> RenderThemeWin::create()
     return adoptRef(*new RenderThemeWin);
 }
 
-Ref<RenderTheme> RenderTheme::themeForPage(Page* page)
+RenderTheme& RenderTheme::singleton()
 {
-    static RenderTheme& winTheme = RenderThemeWin::create().leakRef();
-    return winTheme;
+    static NeverDestroyed<Ref<RenderTheme>> theme(RenderThemeWin::create());
+    return theme.get();
 }
 
 RenderThemeWin::RenderThemeWin()