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

Unified Diff: src/lazy/SkDiscardableMemoryPool.cpp

Issue 1948313002: Revert of SkOncePtr -> SkOnce (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/fonts/SkRemotableFontMgr.cpp ('k') | src/opts/opts_check_x86.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/lazy/SkDiscardableMemoryPool.cpp
diff --git a/src/lazy/SkDiscardableMemoryPool.cpp b/src/lazy/SkDiscardableMemoryPool.cpp
index d6753def9d2263e84bc8d156c0e317616b5d4025..2be4c755f1e0c3196fbc13a439333c7cdeadd55f 100644
--- a/src/lazy/SkDiscardableMemoryPool.cpp
+++ b/src/lazy/SkDiscardableMemoryPool.cpp
@@ -9,7 +9,7 @@
#include "SkDiscardableMemoryPool.h"
#include "SkImageGenerator.h"
#include "SkMutex.h"
-#include "SkOnce.h"
+#include "SkOncePtr.h"
#include "SkTInternalLList.h"
// Note:
@@ -245,13 +245,11 @@
}
SK_DECLARE_STATIC_MUTEX(gMutex);
+SK_DECLARE_STATIC_ONCE_PTR(SkDiscardableMemoryPool, global);
SkDiscardableMemoryPool* SkGetGlobalDiscardableMemoryPool() {
- static SkOnce once;
- static SkDiscardableMemoryPool* global;
- once([]{
- global = SkDiscardableMemoryPool::Create(SK_DEFAULT_GLOBAL_DISCARDABLE_MEMORY_POOL_SIZE,
- &gMutex);
+ return global.get([] {
+ return SkDiscardableMemoryPool::Create(SK_DEFAULT_GLOBAL_DISCARDABLE_MEMORY_POOL_SIZE,
+ &gMutex);
});
- return global;
-}
+}
« no previous file with comments | « src/fonts/SkRemotableFontMgr.cpp ('k') | src/opts/opts_check_x86.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698