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

Unified Diff: third_party/WebKit/Source/platform/ScriptForbiddenScope.h

Issue 2753203002: Annotate the benign race in ScriptForbiddenScope::isScriptForbidden(). (Closed)
Patch Set: Created 3 years, 9 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 | « no previous file | 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/ScriptForbiddenScope.h
diff --git a/third_party/WebKit/Source/platform/ScriptForbiddenScope.h b/third_party/WebKit/Source/platform/ScriptForbiddenScope.h
index 4aa19b5ff5e1ef72fd95d04ea849913d9a2bc385..df11f5c33cc362b17f389f0e9aff7dd47d9cce6f 100644
--- a/third_party/WebKit/Source/platform/ScriptForbiddenScope.h
+++ b/third_party/WebKit/Source/platform/ScriptForbiddenScope.h
@@ -8,6 +8,7 @@
#include "platform/PlatformExport.h"
#include "wtf/Allocator.h"
#include "wtf/AutoReset.h"
+#include "wtf/DynamicAnnotations.h"
#include "wtf/Optional.h"
namespace blink {
@@ -52,6 +53,9 @@ class PLATFORM_EXPORT ScriptForbiddenScope final {
// Check s_scriptForbiddenCount first to avoid any calls to isMainThread()
// since under normal situations where we check this (ex. inside
// V8ScriptRunner) the value should always be zero.
+ WTF_ANNOTATE_BENIGN_RACE(&s_scriptForbiddenCount,
Alexander Potapenko 2017/03/17 10:14:50 Please no. WTF_ANNOTATE_BENIGN_RACE is a beast we
+ "Safe to racy read s_scriptForbiddenCount since "
+ "the value only matters on the main thread.");
return s_scriptForbiddenCount && isMainThread();
Alexander Potapenko 2017/03/17 10:14:50 If the value only matters on the main thread, how
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698