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

Unified Diff: src/core/SkOpts.cpp

Issue 1894893002: Modernize and trim down SkOnce. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: might as well class Created 4 years, 8 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 side-by-side diff with in-line comments
Download patch
Index: src/core/SkOpts.cpp
diff --git a/src/core/SkOpts.cpp b/src/core/SkOpts.cpp
index 570e329094cfac0111e08a10893bb9d958dd2279..3c6b5c12c8ae5324c782598d7486c81d66127a27 100644
--- a/src/core/SkOpts.cpp
+++ b/src/core/SkOpts.cpp
@@ -137,8 +137,10 @@ namespace SkOpts {
#endif
}
- SK_DECLARE_STATIC_ONCE(gInitOnce);
- void Init() { SkOnce(&gInitOnce, init); }
+ void Init() {
+ static SkOnce once;
+ once(init);
+ }
#if SK_ALLOW_STATIC_GLOBAL_INITIALIZERS
static struct AutoInit {

Powered by Google App Engine
This is Rietveld 408576698