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

Unified Diff: third_party/WebKit/Source/platform/heap/Persistent.h

Issue 2680843006: Tidy DEFINE_(THREAD_SAFE_)STATIC_LOCAL() implementations. (Closed)
Patch Set: explain safety of HTMLTableSectionElement singletons Created 3 years, 10 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/platform/heap/Persistent.h
diff --git a/third_party/WebKit/Source/platform/heap/Persistent.h b/third_party/WebKit/Source/platform/heap/Persistent.h
index 26ef9d1e43b55f3d96db3abe573ab417591ca261..38b56979a3cf1f6b64a36886d8e9ac595e368ec1 100644
--- a/third_party/WebKit/Source/platform/heap/Persistent.h
+++ b/third_party/WebKit/Source/platform/heap/Persistent.h
@@ -164,6 +164,18 @@ class PersistentBase {
return this;
}
+#if DCHECK_IS_ON()
+ static void enterNoScriptWrappableScope() {
+ DCHECK(ThreadState::current());
+ ThreadState::current()->enterNoScriptWrappableScope();
+ }
+
+ static void leaveNoScriptWrappableScope() {
+ DCHECK(ThreadState::current());
+ ThreadState::current()->leaveNoScriptWrappableScope();
+ }
+#endif
+
protected:
NO_SANITIZE_ADDRESS
T* atomicGet() {
@@ -580,6 +592,18 @@ class PersistentHeapCollectionBase : public Collection {
return this;
}
+#if DCHECK_IS_ON()
+ static void enterNoScriptWrappableScope() {
+ DCHECK(ThreadState::current());
+ ThreadState::current()->enterNoScriptWrappableScope();
+ }
+
+ static void leaveNoScriptWrappableScope() {
+ DCHECK(ThreadState::current());
+ ThreadState::current()->leaveNoScriptWrappableScope();
+ }
+#endif
+
private:
template <typename VisitorDispatcher>
void tracePersistent(VisitorDispatcher visitor) {

Powered by Google App Engine
This is Rietveld 408576698