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: third_party/WebKit/Source/platform/MemoryCoordinator.cpp

Issue 2251643002: Make MemoryCoordinator garbage collected (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 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 | « third_party/WebKit/Source/platform/MemoryCoordinator.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/platform/MemoryCoordinator.cpp
diff --git a/third_party/WebKit/Source/platform/MemoryCoordinator.cpp b/third_party/WebKit/Source/platform/MemoryCoordinator.cpp
index 96fa073243f44e8c6af25ce2f388a258c1fd6eae..65b3b0dc21698e8a9e0902fcbdcd0c5334389fea 100644
--- a/third_party/WebKit/Source/platform/MemoryCoordinator.cpp
+++ b/third_party/WebKit/Source/platform/MemoryCoordinator.cpp
@@ -18,18 +18,16 @@ DEFINE_TRACE(MemoryCoordinatorClient)
MemoryCoordinator& MemoryCoordinator::instance()
{
- DEFINE_STATIC_LOCAL(MemoryCoordinator, instance, ());
- return instance;
+ static Persistent<MemoryCoordinator>* instance;
+ if (!instance)
+ instance = new Persistent<MemoryCoordinator>(new MemoryCoordinator);
keishi 2016/08/16 08:41:34 This may be shorter DEFINE_STATIC_LOCAL(Persistent
+ return *instance->get();
}
MemoryCoordinator::MemoryCoordinator()
{
}
-MemoryCoordinator::~MemoryCoordinator()
-{
-}
-
void MemoryCoordinator::registerClient(MemoryCoordinatorClient* client)
{
DCHECK(isMainThread());
« no previous file with comments | « third_party/WebKit/Source/platform/MemoryCoordinator.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698