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

Unified Diff: third_party/WebKit/Source/core/editing/markers/DocumentMarker.cpp

Issue 1850413002: Improve DEFINE_STATIC_LOCAL()'s handling of Blink GCed objects. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: address compilation failure 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: third_party/WebKit/Source/core/editing/markers/DocumentMarker.cpp
diff --git a/third_party/WebKit/Source/core/editing/markers/DocumentMarker.cpp b/third_party/WebKit/Source/core/editing/markers/DocumentMarker.cpp
index 1e4c4903777e861dc5e0ffd86b89236aa754fb3d..eb20de300cd8714e05d3ee1325bc3778a50f893d 100644
--- a/third_party/WebKit/Source/core/editing/markers/DocumentMarker.cpp
+++ b/third_party/WebKit/Source/core/editing/markers/DocumentMarker.cpp
@@ -30,6 +30,8 @@
#include "core/editing/markers/DocumentMarker.h"
+#include "wtf/StdLibExtras.h"
+
namespace blink {
DocumentMarkerDetails::~DocumentMarkerDetails()
@@ -83,9 +85,9 @@ private:
RawPtr<DocumentMarkerTextMatch> DocumentMarkerTextMatch::create(bool match)
{
- DEFINE_STATIC_REF_WILL_BE_PERSISTENT(DocumentMarkerTextMatch, trueInstance, (new DocumentMarkerTextMatch(true)));
- DEFINE_STATIC_REF_WILL_BE_PERSISTENT(DocumentMarkerTextMatch, falseInstance, (new DocumentMarkerTextMatch(false)));
- return match ? trueInstance : falseInstance;
+ DEFINE_STATIC_LOCAL(DocumentMarkerTextMatch, trueInstance, (new DocumentMarkerTextMatch(true)));
+ DEFINE_STATIC_LOCAL(DocumentMarkerTextMatch, falseInstance, (new DocumentMarkerTextMatch(false)));
+ return match ? &trueInstance : &falseInstance;
}
inline DocumentMarkerTextMatch* toDocumentMarkerTextMatch(DocumentMarkerDetails* details)
« no previous file with comments | « third_party/WebKit/Source/core/editing/EditingStyle.cpp ('k') | third_party/WebKit/Source/core/events/EventDispatcher.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698