Chromium Code Reviews| 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
|
| } |